Run pdfMaker from macro

R

Richard

Shell "C:\Address\of\program\you\want\to\run.exe"
hehe
It will run it in a new window though
Not sure if this is what your wanting though
 
M

Michael Bednarek

Can I run pdfmaker programatically from within a protected
form?

Recording the menu actions produced this macro line:
Application.Run MacroName:="AdobePDFMakerA.AutoExec.ConvertToPDF"

However, I find that printing to the Distiller Printer is more to my
liking:

Here are some code fragments that might help:

' Requires a Reference to "Acrobat Distiller" (ACRODIST.EXE)

Dim myPDF As New PdfDistiller ' Class PDFDistiller
Dim oldPrinter As String

oldPrinter = ActivePrinter

' Select a printer without changing the system default printer:
With Dialogs(wdDialogFilePrintSetup)
.Printer = "Acrobat Distiller"
.DoNotSetAsSysDefault = True
.Execute
End With

' Next two statements control name of PDF file.
Application.PrintOut OutputFileName:=myPath & myFilename & ".ps", _
PrintToFile:=True, Background:=False
myPDF.FileToPDF myPath & myFilename & ".ps", "", _
theFolder & "\eBook-WebReports.joboptions"

' Select a printer without changing the system default printer:
With Dialogs(wdDialogFilePrintSetup)
.Printer = oldPrinter
.DoNotSetAsSysDefault = True
.Execute
End With

' Restore "PrintToFile" back to false by printing nothing!
' See: http://www.mvps.org/word/FAQs/MacrosVBA/ResetPrintToFile.htm
Application.PrintOut Range:=wdPrintRangeOfPages, Pages:="0", _
PrintToFile:=False
Set myPDF = Nothing

Good luck.
 
J

Jonathan West

Richard said:
Shell "C:\Address\of\program\you\want\to\run.exe"
hehe
It will run it in a new window though
Not sure if this is what your wanting though

It isn't what he was wanting, because PDFMaker isn't a separate executable,
it is a macro supplied by Adobe in an add-in.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 
M

michael Hall

I want to run the Adobe Macro so I can take advantage of
it's automatic bookmark and other features. When I run a
macro that is recorded as you suggested, I get an error.
If I unprotect the form, execute pdfMaker manually, then
run the macro on the unprotected form it works. If I then
reprotect the form all the data is deleted. I want the
user to fill out the form, edit it later if necessary, and
create a pdf all without unprotecting ther contents of the
form.

I would also like to run pdfMaker in batch to create a
series of pdf's from word.doc's creating bookmarks for
word styles automatically.
 
J

Jonathan West

Hi Michael,

I already gave you a detailed answer to the same question you asked in the
userforms group. Please don't post multiple copies of the same question in
different groups, it makes it harder both for you and for the volunteers who
answer these questions to keep track of what has been answered and what
hasn't.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 

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