Print to file

Print to file

Post by meth » Sat, 06 Oct 2007 16:59:29


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.
 
 
 

Print to file

Post by Jean-Guy M » Sat, 06 Oct 2007 23:10:10

meth was telling us:
meth nous racontait que :


See
http://www.yqcomputer.com/

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
XXXX@XXXXX.COM
Word MVP site: http://www.yqcomputer.com/

 
 
 

Print to file

Post by Jay Freedm » Sat, 06 Oct 2007 23:53:21

Try this:

http://www.yqcomputer.com/

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

Print to file

Post by meth » Tue, 09 Oct 2007 15:51:20


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.