WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Word

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How do I print a MS Word document to to a PostScript printer

Keywords:   print a MS Word documentPostScript printer 

Question:

How do I print a MS Word document to to a PostScript printer (port is file) and pass the file name I want to use.

Answer:

;	create word object...
oWord = objectopen("Word.Application")
;	set the documents object...
oDocs = oWord.documents
;	open a preset file...
oDocs.open("C:\temp\test.doc")
;get active document
oDoc = oWord.ActiveDocument
;	make word visible...
oWord.visible = @True ;Change to @False to hide
oWord.PrintOut(::FileName="C:\temp\test.doc")

oDoc.Save
oDoc.Close
oWord.Quit
ObjectClose(oDoc)
ObjectClose(oDocs)
ObjectClose(oWord)




Article ID:   W15664
File Created: 2003:05:13:11:29:24
Last Updated: 2003:05:13:11:29:24