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 / October 2007

Tip: Looking for answers? Try searching our database.

Print to file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
meth - 05 Oct 2007 08:59 GMT
Hello all,

I have an annoying problem.

MyPrinter = ActivePrinter
ActivePrinter = "FilePrinter on FILE:"
strFileName = Left(ActiveDocument.AttachedTemplate,
Len(ActiveDocument.AttachedTemplate) - 4)
strFileType = ".prn"
strDocNames = "C:\Temp\" & strFileName  & strFileType
Application.PrintOut Background:=False, Append:=False,
Range:=wdPrintAllDocument, OutputFileName:=strDocNames,
Item:=wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, Collate:=True
ActivePrinter = MyPrinter

The next time I want to print a document with the File -> Print dialog
(no macro this time), then the Print to file checkbox is still on. And
there seems to be no way to switch it off elegantly. I tried this:

With Dialogs(wdDialogFilePrint)
    .printtofile =0
    .Execute
End With

which results in printing the document (which I don't want...I just
want a .prn file, no "real" print)

I tried

With Dialogs(wdDialogFilePrint)
    .printtofile =0
    .Update
End With

which doesn't uncheck the check box. Actually I tried pretty much
everything that I could come up with. Closing Word is not an option.
While browsing I found several posts on this matter...alas all without
a viable solution.

I'd be really grateful for any suggestions.

TIA

Raph.
Jean-Guy Marcil - 05 Oct 2007 15:10 GMT
meth was telling us:
meth nous racontait que :

> Hello all,
>
[quoted text clipped - 37 lines]
>
> I'd be really grateful for any suggestions.

See
   http://www.mvps.org/word/FAQs/MacrosVBA/ResetPrintToFile.htm

Signature

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

Jay Freedman - 05 Oct 2007 15:53 GMT
Try this:

http://word.mvps.org/FAQs/MacrosVBA/ResetPrintToFile.htm

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> Hello all,
>
[quoted text clipped - 41 lines]
>
> Raph.
meth - 08 Oct 2007 07:51 GMT
> Try this:
>
[quoted text clipped - 52 lines]
>
> > Raph.

Jean-Guy and Jay,

Thank you so much for pointing this one out to me. I've spent a lot of
time on this one. Although I checked the MVPS site, I missed the
solution.

Again guys, thank you very much....you brightened my Monday ;-)

Raph.
 
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.