Printing With Code

J

Joel

Hello,

Here is some code I use to print a Word template. But how can I make it
print from a certain printer and print a certain # of copies?

Sub CommandButtonPilkRelease_Click()
Dim objDoc
Set objDoc =
GetWordDocPilkRelease("\\tgps8\drawing$\Jobs\Task_Templates\ReleaseGlass.dot
")
Call FillFieldsPilkRelease(objDoc)
objDoc.Application.Options.PrintBackground = True
objDoc.PrintOut
objDoc.Close wdDoNotSaveChanges
Call RestoreWordPilkRelease
Set objDoc = Nothing
End Sub
 
S

Sue Mosher [MVP-Outlook]

When in doubt, check the object browser: Press ALt+F11 to open the VBA
environment in Outlook, then press F2. If you don't already have a reference
to Word in the VBA project, add it with Tools | References. Switch from <All
Libraries> to Word to browse all Word objects and their properties, methods,
and events. Select any object or member, then press F1 to see its Help
topic.

You should find Application.ActivePrinter and Document.PrintOut useful to
your project.
 
J

Joel

Thank you Sue. Good advice.

Sue Mosher said:
When in doubt, check the object browser: Press ALt+F11 to open the VBA
environment in Outlook, then press F2. If you don't already have a reference
to Word in the VBA project, add it with Tools | References. Switch from <All
Libraries> to Word to browse all Word objects and their properties, methods,
and events. Select any object or member, then press F1 to see its Help
topic.

You should find Application.ActivePrinter and Document.PrintOut useful to
your project.


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top