Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Dec 2001
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating PDF's through VB (VB6/Word Object)

    Is there a way to print to PDFWriter using Visual Basic and not have the File SaveAs Dialog appear. I've tried creating a Word Object and using the syntax;

    Word.ActivePrinter = "Adobe PDFWriter"

    Word.Application.Printout . . . . OutputFileName:="C"tempfilename.doc"

    but the resulting PDF file is empty.

    Any suggestions?

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Marietta, Georgia, USA
    Posts
    296
    Thanks
    9
    Thanked 4 Times in 4 Posts

    Re: Creating PDF's through VB (VB6/Word Object)

    I have attached a text file with the code that I use. It is pretty long, and it involves several WIndows API calls.

    This used to be posted out at the Adobe web site user forums, but they delete old stuff after about six months.
    Rick Groszkiewicz
    Life is too short to drink bad wine (or bad coffee!)

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    L.A., California
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating PDF's through VB (VB6/Word Object)

    There's also an excellent 3rd party product called Win2PDF, which installs itself as a Windows printer on your system. You then only have to print to that printer. It will automatically prompt you for a file name. Alternatively, you can write some vb code to create a registry entry with the path and file name you want, and it won't even bother asking you. There's a free trial period, during which an extra "nag" page is added to the end of your pdf file. The good news is it's only $35.00 to register it. Go to www.daneprairie.com and check it out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •