Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2007

Tip: Looking for answers? Try searching our database.

printout

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
barry - 09 Aug 2007 02:56 GMT
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
Jean-Guy Marcil - 11 Aug 2007 06:19 GMT
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.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

barry - 14 Aug 2007 01:51 GMT
Thanks for you response. Something you said in your response has given me
the answer to my problem.
thanks
> barry was telling us:
> barry nous racontait que :
[quoted text clipped - 20 lines]
> Depending on what you are doping, you will probably need more code to turn
> off "Print to File" aw this setting is stocky.
Jean-Guy Marcil - 14 Aug 2007 02:59 GMT
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...

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.