printout

B

barry

Is this the proper syntax to print a word 2007 document to a file instead of
a printer

ActiveDocument.PrintOut OutputFileName:="c:\zzz.docx", PrintToFile:=1

thank you
 
J

Jean-Guy Marcil

barry was telling us:
barry nous racontait que :
Is this the proper syntax to print a word 2007 document to a file
instead of a printer

ActiveDocument.PrintOut OutputFileName:="c:\zzz.docx", PrintToFile:=1

Try this:

Dim strFileName As String

strFileName = ActiveDocument.FullName

strFileName = Left(strFileName, Len(strFileName) - 4) & ".prn"

Application.PrintOut PrintToFile:=True, _
OutputFileName:=strFileName



Don't forget to turn on the printer, even tough you are printing to file...
(Printing to file produces a document to be printed later on a specific
printer.)
Depending on what you are doping, you will probably need more code to turn
off "Print to File" aw this setting is stocky.


--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
B

barry

Thanks for you response. Something you said in your response has given me
the answer to my problem.
thanks
 
J

Jean-Guy Marcil

barry was telling us:
barry nous racontait que :
Thanks for you response. Something you said in your response has
given me the answer to my problem.
thanks

I am glad you could find something useful in the gibberish I posted...
Sorry, I forgot to spell-check it...

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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