Create PDF in VB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey Everyone

I have a difficult question: How can I save a document as a pdf file from the database? The proceess I'm looking for is something like this..

Select the file to convert in a Dialog bo
The database captures the file's name and locatio
The database creates a pdf with the same name in the same location (but with a pdf extension

This is much more difficult than it seems. I've been working on it for 2 days and I'm still completely stuck. I'm thinking some sort of bat file may work better than VB, but I don't know Windows well enough to write it

The biggest problem is specifying the new pdf file's name and location with VB code. I do not want the users to be able to have a hand in this at all. It needs to be completely under the control of the db.

Any help would be greatly appreciated

Thank you!
 
Thank you Alex. Is there any way to capture the name of the new pdf file you've created, other than to just remember it? Can I capture the new file name in VB?
 
*You* name the file as input to the routine:

RunReportAsPDF(rptName As String, sPDFPath As String, sPDFName As String)

Pass in the path as the second argument and the filename as third. The
routine sticks this into the registry as PDFWriter's default file location,
changes the default printer to PDFWriter, prints the report, then set
everything back to normal.

HTH,

Kevin
Justin said:
Thank you Alex. Is there any way to capture the name of the new pdf file
you've created, other than to just remember it? Can I capture the new file
name in VB?
 
Justin:

Take a look at our PDF and Mail Library for Access. It supports multiple
PDF drivers including Acrobat 6. You can name your PDF file anything you
want in code and then store that information in a table if you'd like.
You'll find it on our web.
 
Back
Top