Save (print) active PDFdocument via PDFCreator (VBA)


#1

Dear all,

I need to save automatically opened (active) PDF file from access DB via VBA.  The path and the name are defined in access form. 
the problem is to apply to that opened PDF file, it is not saved to computer, I just open it from outlook message.
Please help, if there is any way to apply to that pdf active opened file something like how I apply to excel - 
xl.ActiveSheet.PrintOut Copies:=1, ActivePrinter:="PDFCreator"

so I can print (save) it by PDFCreator ?
Thanks a lot!!!

#2

Couple of years too late,
but i used to solve it by putting the path and filename in the clipboard before printing to pdf

    Dim MyText As DataObject
    Set MyText = New DataObject
    vrLB0pdfFile = "c:\dir\subdir\filename.pdf"
    MyText.SetText CStr(vrLB0pdfFile)
    MyText.PutInClipboard
   Application.ActivePrinter = PRINTPDF
   ActiveWorkbook.PrintOut Copies:=1, ActivePrinter:=PRINTPDF, Collate:=True

and afterwards ctrl-v path and filename string when saves as location is prompted by pdfcreator.

However the latest versions require path and filename to be in a seperate field.