Aandi Inston
Set lobjAdobeApp = CreateObject("AcroExch.App")
Set lobjAdobeDoc = CreateObject("AcroExch.AVDoc")
szDirPath = "c:\test\" '"C:\testpdf\"
szFileName = "OutFile.ps"
szPDFName = "env.PDF" '"TestFile.pdf"
szTemp = szDirPath & Trim(szPDFName) ' full path to pdf file
lobjAdobeDoc.Open szTemp, szFileName 'open the file, with the final filename as the title of the window
If (lobjAdobeDoc.IsValid = True) Then ' we opened the document ok
Set lobjAdobePDDoc = lobjAdobeDoc.GetPDDoc()
nLastPage = lobjAdobePDDoc.GetNumPages() - 1 'Adobe is picky about having the correct page count.
lobjAdobeDoc.PrintPages 0, nLastPage, 1, 0, 0 'print the document to the default print driver
lobjAdobePDDoc.Close 'shut everything down nicely
lobjAdobeDoc.Close 0
'FileCopy "c:\RightFax.prn", szDirPath & Trim(szFileName) 'copy the new file to something your app understands
'Kill "c:\RightFax.prn" 'clean it out.. not necessary as the next print will overwrite, but I'm paranoid
MsgBox "Postscript file created successfully"
Else
'MsgBox "Could not open " & szPDFName & " in Acrobat" 'something VERY BAD has happened.
SendKeys "{ENTER}", True
End If
And PS files don't travel well (e.g. to other platforms) unless you really know what goes into them.
Regards,
Victor Lee.
Regards,
Victor Lee.