Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Run pdfMaker from macro

77 views
Skip to first unread message

Michael Hall

unread,
Sep 19, 2003, 1:28:31 PM9/19/03
to
Can I run pdfmaker programatically from within a protected
form?

Richard

unread,
Sep 21, 2003, 11:09:55 PM9/21/03
to
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
>.
>

Michael Bednarek

unread,
Sep 22, 2003, 3:56:17 AM9/22/03
to
On Fri, 19 Sep 2003 10:28:31 -0700, "Michael Hall"
<michae...@dot.state.wi.us> wrote in
microsoft.public.word.vba.general:

>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.

--
Michael Bednarek, IT Manager, Tactical Global Management
Waterfront Pl, Brisbane 4000, Australia. "POST NO BILLS"
http://mcmbednarek.tripod.com/

Jonathan West

unread,
Sep 22, 2003, 3:59:06 AM9/22/03
to

"Richard" <rl...@bellsouth.net> wrote in message
news:009201c380b6$ff7162d0$a001...@phx.gbl...

> 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


michael Hall

unread,
Sep 23, 2003, 3:44:37 PM9/23/03
to
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.

>.
>

Jonathan West

unread,
Sep 23, 2003, 3:52:54 PM9/23/03
to
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

"michael Hall" <michae...@dot.state.wi.us> wrote in message
news:081401c3820b$1ed766b0$a101...@phx.gbl...

0 new messages