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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print a Word document?

Status
Not open for further replies.

shannanl

IS-IT--Management
Apr 24, 2003
1,071
US
I am using the following code to open a Word document. How do I automatically print that document?

Dim oWord
Dim WordDoc
oWord = CreateObject("Word.Application")
WordDoc = oWord.documents.open(myPath)
oWord.Visible = True

Thanks in advance,

Shannan
 
Dim oWord
Dim WordDoc
Set oWord = CreateObject("Word.Application")
Set WordDoc = oWord.Documents.Open(myPath)
oWord.Visible = True
WordDoc.PrintOut False


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Okay, here is a question.

I copy your code into a blank form, change "myPath" to an actual path and it prints fine.

I drop your code into my form and it only displays it. After the code group, I populate some bookmarks in the Word document. How could that cause it not to print? I know the path is good because it opens up the form.

Any suggestions?

Thanks,

Shannan
 
I drop your code into my form and it only displays it. After the code group, I populate some bookmarks in the Word document. How could that cause it not to print? I know the path is good because it opens up the form.
Huh?

Could you explain that???

What form?

What is the "it" that is displayed?? The code is displayed?? What?

Code group????

Gerry
My paintings and sculpture
 
I am using vb.net. It is a .net form. If I use the bookmarks, the Word document only displays, not prints.

Sorry for the confusion.

Shannan


 
If I use the bookmarks, the Word document only displays, not prints.
Sorry, but that does not help. What does "use bookmarks" mean? What does "display" mean?

It may help if you actually stated what you are doing. Your post is about automatically printing a document. Now you seem to be performing action on the document.

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top