Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer.Print to PDF 1

Swi

Programmer
Feb 4, 2002
1,971
US
Hi,

Is there a way to use Printer Print method to Microsoft PDF printer and save as a file without the save dialog?

Thanks.
 
A startup script in task in task scheduler?
I dont know if it would work or not.
If the service is requested then do these commands.... thats what im thinking...
A batch script command ?
 
I've done printing to PDF using VBA in MS-Access, if the code is compatible to regular Visual Basic, I can try to locate it when I get back to the office. You will need to pass in the filename and pathlocation where to save it as a variable or hard code.
 
The task scheduler will run if the process is called .. the task will be the bat file that performs the functions... or the task could just be a list of functions that are added to the task..
 
I use open office for documents.. it has a pdf creation functions... it can use macros. it has auto save functions in the application it might be worth looking at..
Ocr and file output type is worth a google search too...
 
I've done printing to PDF using VBA in MS-Access, if the code is compatible to regular Visual Basic, I can try to locate it when I get back to the office. You will need to pass in the filename and pathlocation where to save it as a variable or hard code.
If you have the code I would like to look at it. Thanks.
 
If only. No, the Microsoft Print to PDF printer is fairly dumb. There are various suggested workarounds using live hacks to the registry, or by using various API calls. But they are all frankly either useless or very limited in capability when it comes to the Microsoft Print to PDF printer (e.g they can print a text file from disk to the printer, but not one of your forms from your application).

To be honest, my recommendation, if you need any level of control of a PDF printer is to use CutePDF or BullZip PDF (the latter being my current preference)
 
Last edited:
To be honest, my recommendation, if you need any level of control of a PDF printer is to use CutePDF or BullZip PDF (the latter being my current preference)
I like this answer sounds like he has seen something like it....
 
>f the code is compatible to regular Visual Basic

Printing in VB6 differs somewhat from printing from any of the Office applications using VBA (and capabilities differ between different Office apps)
 
>Macros in excel or open office

This is not an Office or VBA forum. This is a forum for VB6 ...
 
Just thinking of ideas that might lead to solutions... sorry i didnt realizie it was that mission critical thanks.... i cant program vb at all but i understand the os pretty well...
 
If you have the code I would like to look at it. Thanks.
Printing in VB6 differs somewhat from printing from any of the Office applications using VBA (and capabilities differ between different Office apps)
Using Office VBA code makes sense in case of automating one of Office applications. They use internal configurable converters for generating pdfs. Excel, Word and PowerPoint use document's ExportAsFixedFormat method (PowerPoint has two additional variants), Access DoCmd.OutputTo method. Recording macro (Word, Excel) and/or exploring respective application's object browser and online help will provide additional info about these methods.
 
I think the issue here is that Swi wants to be able to create a PDF directly from VB6

As you point out, and it's no great secret, Office apps have built-in functionality for publishing PDFs from their various documents, but that's a answering a very different different question, and there is no easy way to print a VB6 form via an Office app (and there is no hint in Swi's OP that they are simply trying to automate Office apps)

Let's see what Swi has to say.
 
strongm is correct. Got it working using his recommendation. Thanks 👍
 

Part and Inventory Search

Sponsor

Back
Top