word macro help

claudz_08

Registered User.
Local time
Tomorrow, 02:58
Joined
Jun 3, 2003
Messages
17
I need your help. what i need to do is create a macro in word. When you open a file in word format a macro will run that will find printer 1 and make it as the default printer. Once set to default printer it will print the document on the word then once printed it will change again the default printer and this time it would be printer 2 then print the document again then once printed it, it will close the document.

what i currently did is find the printer folder using msdos but i'm having problem choosing the printer bec. i can't just use the sendkeys command bec. order of printers are not all the same for all computers. here's the command i used for opening the printer folder

Shell Environ$("Comspec") & " /c C:\progra~1\micros~2\Office\Shortc~1\Office\printers.lnk", vbNormalFocus


please help.....asap!

thanks
 
I'm not sure but could this help?
Code:
Sub AutoOPen() 

Dim strActivePrinter As String

    strActivePrinter = Application.ActivePrinter

       ' Change printer 
          Application.ActivePrinter = "\\Server02\blah blah"
           'Your print command here
       ' Reset printer to original  
          Application.ActivePrinter = strActivePrinter
           'your second print command here

End Sub

IMO
 
Last edited:
thanks to your help but i need help how to access the printer. Our printer here is through network. It has it's own IP address.

I know the path where the printer is but then selecting a certain printer is the problem. I have found something on the help menu which is

ActivePrinter = HP laserjey 1200 PCl 6 on \\printer...this doesn't works so i tried changing the path of the printer to

ActivePrinter = HP laserjey 1200 PCl 6 on C:\progra~1\micros~2\Office\Shortc~1\Office\printers.lnk (this doesn't work either bec. this path is for the printer folder only. I don't know how to select the printer itself.)


Is there a way i can access the printer by selecting it's Ip address?

thanks
 

Users who are viewing this thread

Back
Top Bottom