View Full Version : word macro help


claudz_08
10-01-2003, 03:09 AM
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\printe rs.lnk", vbNormalFocus


please help.....asap!

thanks

IMO
10-01-2003, 05:26 AM
I'm not sure but could this help?

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

claudz_08
10-01-2003, 06:39 PM
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\printe rs.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

AngelicGuardian
10-31-2003, 12:26 PM
yes you can access the printer by \\IP address here