L
LeAnn
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
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