Is it possible to save/restore individual Printout args?

H

Howard Kaikow

For example, in the following, I'm trying to save, then restore the Print to
File option.
Doesn't seem to work.

With Dialogs(wdDialogFilePrint)
blnPrintToFile = .printtofile
.FileName = strInputFile
.prtofilename = strOutputFilePath
.printtofile = True
.Execute
.printtofile = blnPrintToFile
.Update
End With

Is there a better way to do this in VBA?
 
J

JGM

Hi Howard,

Try this:

With Dialogs(wdDialogFilePrint)
blnPrintToFile = .PrintToFile
.FileName = strInputFile
.prtofilename = strOutputFilePath
.PrintToFile = True
.Execute
End With

Application.PrintOut _
Range:=wdPrintRangeOfPages, _
Pages:="0", _
PrintToFile:=blnPrintToFile

I got it from:
http://www.mvps.org/word/FAQs/MacrosVBA/ResetPrintToFile.htm
after radin about tons of people who had the same problem... Iremembered
reading about the exact same problem before...
See:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=printToFile&bt
nG=Google+Search&meta=group%3Dmicrosoft.public.word.*


HTH
Cheers!
 
H

Howard Kaikow

Thanx.
--
http://www.standards.com/; See Howard Kaikow's web site.
JGM said:
Hi Howard,

Try this:

With Dialogs(wdDialogFilePrint)
blnPrintToFile = .PrintToFile
.FileName = strInputFile
.prtofilename = strOutputFilePath
.PrintToFile = True
.Execute
End With

Application.PrintOut _
Range:=wdPrintRangeOfPages, _
Pages:="0", _
PrintToFile:=blnPrintToFile

I got it from:
http://www.mvps.org/word/FAQs/MacrosVBA/ResetPrintToFile.htm
after radin about tons of people who had the same problem... Iremembered
reading about the exact same problem before...
See:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=printToFile&bt
nG=Google+Search&meta=group%3Dmicrosoft.public.word.*


HTH
Cheers!
--
_______________________________________
Jean-Guy Marcil
(e-mail address removed)

Howard Kaikow said:
For example, in the following, I'm trying to save, then restore the
Print
 

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