Word Macro Saving as PDF

J

JediKaiti

Hello! I have an AutoNew() macro in a Word 2007 template, and I have a
question about saving the document as a PDF file.

My macro, among other things, does this:
With ActiveDocument
.SaveAs .AttachedTemplate.Path & "\Handbook.pdf", FileFormat:=17
End With

I am wondering if it is possible, and if so how, to have the macro
automatically set the option to create bookmarks from the headers in the
document? Right now it only does so if the person using the template has that
option set. I'd like to have the macro set it for them.

Thanks!
 
D

Doug Robbins - Word MVP

Instead of using .SaveAs, use the .ExportAsFixedFormat Method and then you
can use the wdExportCreateHeadingBookmarks attribute, which if set to 1 will
create a bookmark in the exported document for each heading within the main
document and text boxes.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
J

JediKaiti

That did it, thanks!

Doug Robbins - Word MVP said:
Instead of using .SaveAs, use the .ExportAsFixedFormat Method and then you
can use the wdExportCreateHeadingBookmarks attribute, which if set to 1 will
create a bookmark in the exported document for each heading within the main
document and text boxes.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.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