I'm writing a VB program that needs to rename files, and then convert some of them to PostScript. Here's what I tried doing.
Set acrobatApp = CreateObject("AcroExch.App")
Set pdfDoc = CreateObject("AcroExch.PDDoc")
pdfDoc.Open "C:myfile.pdf"
strPDFFileName = "C:myfile.ps"
pdfDoc.Save &H1, strPDFFileName
pdfDoc.Close
acrobatApp.CloseAllDocs
acrobatApp.exit
Set pdfDoc = Nothing
This did not work, because even though it appeared to have saved it as a PostScript, it was still a PDF. That makes sense, I would think I need to do a SaveAs
And here's where I have the problem. Tried different combinations (DocSaveAs on the AcroApp as well as PDFDOC object).
Decided to try the MenuItemExecute. But although I see examples suggesting using the "Open" and "Saveas"
AcroApp.MenuItemExecute ("Open")
AcroApp.MenuItemExecute ("SaveAs")
there's no hint on the syntax for the filename to open and save as. where do I provide the file name to open..and filename to save as?
I tried ...
AcroApp.MenuItemExecute ("Open") filename
AcroApp.MenuItemExecute ("SaveAs") filenamesaeas..
I even tried
AcroApp.MenuItemExecute ("Open")
SendKeys ("testpdf{Enter}")
AcroApp.MenuItemExecute ("SaveAs")
SendKeys ("sample.ps{Enter}")
but no luck...please help.
Set acrobatApp = CreateObject("AcroExch.App")
Set pdfDoc = CreateObject("AcroExch.PDDoc")
pdfDoc.Open "C:myfile.pdf"
strPDFFileName = "C:myfile.ps"
pdfDoc.Save &H1, strPDFFileName
pdfDoc.Close
acrobatApp.CloseAllDocs
acrobatApp.exit
Set pdfDoc = Nothing
This did not work, because even though it appeared to have saved it as a PostScript, it was still a PDF. That makes sense, I would think I need to do a SaveAs
And here's where I have the problem. Tried different combinations (DocSaveAs on the AcroApp as well as PDFDOC object).
Decided to try the MenuItemExecute. But although I see examples suggesting using the "Open" and "Saveas"
AcroApp.MenuItemExecute ("Open")
AcroApp.MenuItemExecute ("SaveAs")
there's no hint on the syntax for the filename to open and save as. where do I provide the file name to open..and filename to save as?
I tried ...
AcroApp.MenuItemExecute ("Open") filename
AcroApp.MenuItemExecute ("SaveAs") filenamesaeas..
I even tried
AcroApp.MenuItemExecute ("Open")
SendKeys ("testpdf{Enter}")
AcroApp.MenuItemExecute ("SaveAs")
SendKeys ("sample.ps{Enter}")
but no luck...please help.