How do I create a .pdf file from a Word .doc?
I'm using PDFCreator and VB 08 Pro.
The code below creates the .pdf file, but when I try to open it, I get the following error message:
"Adobe could not open 'tt.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)...
Thank you for your help.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim msword As word.application
Dim msDoc As Word.Document
Dim wordDoc As String = "C:\tt.doc"
Dim pdfDoc As String = "C:\tt.pdf"
msword = CreateObject("Word.Application")
msDoc = msword.Documents.Open(wordDoc)
msword.Application.Visible = False
msword.ActivePrinter = "PDFCreator"
msDoc.PrintOut(, , , pdfDoc)
msDoc = Nothing
msword = Nothing