Convert Word doc to PDF Corruption

G

Guest

At the risk of repeating this question and irritating some folks, but I have
read and searched for a solution/code that will accomplish what I need and so
far it isn’t looking hopeful.

I inherited a database that I converted to Access 2003. There is a button
that creates a word document and saves it to a directory. What I would like
to do instead is convert this word document to a pdf and save it in that same
directory. I installed CutePDF Writer and am trying to use some code from
one of the postings here (modified a bit). I was finally sucessful in
creating the pdf (YEAH!) but the file is corrupted when I try to open it
(Acrobat Reader 5). The error states: “……it is either not a supported file
type or the file has benn corrupted……..â€

Is there something wrong with my PrintOut statement?

'objDoc.SaveAs UDREPORT & Me.ReqNum & ".doc" OLD line of code commented
out

Dim strPrinter As String, strPath As String
strPrinter = Application.Printer.DeviceName
If Application.Printer.DeviceName = "CutePDF Writer" Then
'do nothing
Else
Set Application.Printer = Application.Printers("CutePDF Writer")
End If

strPath = UDREPORT & Me.ReqNum & ".pdf"
objDoc.PrintOut OutputFileName:=strPath, PrintToFile:=True


Thanks
LeAnn
 
G

Guest

Ok, I see my excitement at having created a pdf file was foolish. I realize
now that I forced the .pdf extension so it appeared to be a pdf.

Any suggestions that might help me?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top