Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 303
Default word more intelligent than excel???

Working with network prionters it has been a problem to tell excel which
port the printer is on. I.e. either Ne01, Ne02, Ne03 or Ne04.

E Ehren came up with a solution ,,, looping through the possible numbers
untill there was a match. This works fine in excel.

Used the same code to prevent the problem in a word macro.
It appears that word can intuitively pick up the right number.

The word macro .................

oldpname = Application.ActivePrinter 'at this stage printer is the default
inkjet printer
__don't need this__For j = 0 To 9
__don't need this__On Error Resume Next
__don't need this__temppname = "\\nzdfprn01\Label_UHT_Sato on Ne0" & j & ":"

instead use this..................
temppname = "\\nzdfprn01\Label_UHT_Sato "
Application.ActivePrinter = temppname 'it selects the right printer here
'application
active printer is now the sato label printer on Ne03 for instance
__don't need this__If Application.ActivePrinter = temppname Then
__don't need this__Exit For
__don't need this__End If
__don't need this__Next j

printlabel
Application.ActivePrinter = oldpname
End Sub

The lines with __don't need this__ are necessary in the excel macro to be
able to find the right number.

Is there another way for excel to make it "smarter"?
I don't like to have to accept that word is smarter.


Regards
Bill Kuunders


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default word more intelligent than excel???

Bill,

goto http://groups.google.com
search for: list-of-printers author:keepITcool

you should get a thread (this NG) from Jan22 with messageID
oft.com

that function will give you exactly what you want.



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Bill Kuunders wrote :

Working with network prionters it has been a problem to tell excel
which port the printer is on. I.e. either Ne01, Ne02, Ne03 or Ne04.

E Ehren came up with a solution ,,, looping through the possible
numbers untill there was a match. This works fine in excel.

Used the same code to prevent the problem in a word macro.
It appears that word can intuitively pick up the right number.

The word macro .................

oldpname = Application.ActivePrinter 'at this stage printer is the
default inkjet printer
__don't need this__For j = 0 To 9
__don't need this__On Error Resume Next
__don't need this__temppname = "\\nzdfprn01\Label_UHT_Sato on Ne0" &
j & ":"

instead use this..................
temppname = "\\nzdfprn01\Label_UHT_Sato "
Application.ActivePrinter = temppname 'it selects the right printer
here
'application active printer is now the sato label printer on Ne03 for
instance __don't need this__If Application.ActivePrinter = temppname
Then __don't need this__Exit For
__don't need this__End If
__don't need this__Next j

printlabel
Application.ActivePrinter = oldpname
End Sub

The lines with __don't need this__ are necessary in the excel macro
to be able to find the right number.

Is there another way for excel to make it "smarter"?
I don't like to have to accept that word is smarter.


Regards
Bill Kuunders

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 303
Default word more intelligent than excel???

To keepITcool

Thank You very much for that code. Haven't used it yet. I'm sure it'll work.
I just wanted to find out why and how word can find the right Ne port number
without any extra code and excel does need more code like the function you
provided.

I.e.
within the two lines ........

temppname = "\\nzdfprn01\Label_UHT_Sato "
Application.ActivePrinter = temppname 'it selects the right printer

.........word identifies the active printer as \\nzdfprn01\Label_UHT_Sato on
NE03

without any extra code.

Bill Kuunders
orig from Deurne NBr

"keepITcool" wrote in message
ft.com...
Bill,

goto http://groups.google.com
search for: list-of-printers author:keepITcool

you should get a thread (this NG) from Jan22 with messageID
oft.com

that function will give you exactly what you want.



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Bill Kuunders wrote :

Working with network prionters it has been a problem to tell excel
which port the printer is on. I.e. either Ne01, Ne02, Ne03 or Ne04.

E Ehren came up with a solution ,,, looping through the possible
numbers untill there was a match. This works fine in excel.

Used the same code to prevent the problem in a word macro.
It appears that word can intuitively pick up the right number.

The word macro .................

oldpname = Application.ActivePrinter 'at this stage printer is the
default inkjet printer
__don't need this__For j = 0 To 9
__don't need this__On Error Resume Next
__don't need this__temppname = "\\nzdfprn01\Label_UHT_Sato on Ne0" &
j & ":"

instead use this..................
temppname = "\\nzdfprn01\Label_UHT_Sato "
Application.ActivePrinter = temppname 'it selects the right printer
here
'application active printer is now the sato label printer on Ne03 for
instance __don't need this__If Application.ActivePrinter = temppname
Then __don't need this__Exit For
__don't need this__End If
__don't need this__Next j

printlabel
Application.ActivePrinter = oldpname
End Sub

The lines with __don't need this__ are necessary in the excel macro
to be able to find the right number.

Is there another way for excel to make it "smarter"?
I don't like to have to accept that word is smarter.


Regards
Bill Kuunders



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Excel count of 1 word if found in multi-word cells of column Function_Challenged Excel Worksheet Functions 1 August 27th 09 12:08 AM
Stop the 'intelligent' copying? Terry Pinnell Excel Discussion (Misc queries) 2 October 26th 08 10:50 AM
Stop the 'intelligent' copying? Terry Pinnell Excel Discussion (Misc queries) 2 October 23rd 08 01:08 PM
Intelligent lookup of a suburb Mike Langensiepen New Users to Excel 3 June 2nd 07 01:29 AM
Intelligent VLOOKUP DKS Excel Worksheet Functions 3 September 19th 06 03:42 AM


All times are GMT +1. The time now is 10:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"