Results 1 to 11 of 11
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Convert doc in pdf without virtual printer (6.0)

    how to...
    Have a c:test.doc i want to convert into same dir the doc, in pdf format.
    Note: without virtual priner, only with free COM, Activex,ecc....
    Note1: all pc where i install application have Acrobat reader 7.0
    Naturally all in VB classic or VBA or use sheel command in VB classic or VBA.
    Tks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Convert doc in pdf without virtual printer (6.0)

    Why don't you want to use a PDF printer?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert doc in pdf without virtual printer (6.

    have difficult with vb ... if i use virtual print is very big prob, or not?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Convert doc in pdf without virtual printer (6.

    If you install a PDF printer, whether it be the "official" one from Adobe, or a free one such as pdf 995, you can simply print a file from within an application to the PDF printer. For example in Word:

    Dim strPrinter As String
    ' Save name of current printer
    strPrinter = Application.ActivePrinter
    ' Make the pdf printer active
    Application.ActivePrinter = "pdf995"
    ' Print the document to a PDF file
    ActiveDocument.PrintOut
    ' Restore original printer
    Application.ActivePrinter = strPrinter

    If you use another PDF creator, the name will be different, of course.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert doc in pdf without virtual printer (6.

    Ok.... tks.
    Installed Pdf995 printer...
    But have difficult to send the print doc via code...
    Admit have the word document in c:test.doc....

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Convert doc in pdf without virtual printer (6.

    If the document is not open, you have to open it in Word, print it to PDF and close the document again.
    Are you doing this in Word, or in Excel, or in VB6?

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert doc in pdf without virtual printer (6.

    Sorry for delay...
    I want to use in VBA for excel...

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Convert doc in pdf without virtual printer (6.

    You'd have to do something like this:

    Dim objWord As Object
    Dim objDoc As Object
    Dim strPrinter As String
    ' Start Word
    Set objWord = CreateObject("Word.Document")
    ' Open document
    Set objDoc = objWord.Documents.Open("c:test.doc")
    ' Save name of current printer
    strPrinter = objWord.ActivePrinter
    ' Make the pdf printer active
    objWord.ActivePrinter = "pdf995"
    ' Print the document to a PDF file
    objDoc.PrintOut
    ' Restore original printer
    objWord.ActivePrinter = strPrinter
    ' Close document
    objDoc.Close SaveChanges:=False
    ' Quit Word
    objWord.Quit
    ' Clean up
    Set objDoc = Nothing
    Set objWord = Nothing

    If you already had a Word.Application object you can use that instead of objWord.

  9. #9
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert doc in pdf without virtual printer (6.

    Little modify and iot work nice...
    But during the code run appear the dialog box to save as the pdf file.. noit is possible to sdet the path in code..
    Tks.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Convert doc in pdf without virtual printer (6.

    Pdf995 comes with a utility pdfedit. You can use it to set your preference:

    1) "Save As" dialog (default).
    2) Automatically name the document based on the originating document and save it to the output folder.
    3). Save all PDF documents to the same filename.

  11. #11
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert doc in pdf without virtual printer (6.

    Sorry for delay, but prob with my pc in my farm attending technical service to adjust the hardware.
    i cannot test now, but tks always.

Posting Permissions

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