Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding & Printing a Word Doc from VBA 1

Status
Not open for further replies.

delboy1295

Technical User
Nov 27, 2003
7
0
0
GB
I wonder if I may call on your expertise to help me with a problem.

I'm developing an app in VBA.

After a particular event, I want to take various data and transfer it to a Word Template. I have set up bookmarks and everything works fine.

At present the document is displayed and can then be printed. I would prefer that the document is not displayed, but two copies are simply printed using the embedded data.
I would also like save the document using a value from one of the fields.

I would appreciate any help you can give me.

Thanking you in anticipation!
 
Hi delboy1295

If you are successfully transferring info into a Word template then I presume you have created an object in code that represents the Word application.

To prevent Word being displayed, set your object's
Code:
.Visible
property to False.

To print out 2 copies, use the .PrintOut method, e.g.
Code:
MyWordObject.ActiveDocument.PrintOut Copies:=2

Regards

Mac
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top