vbams-wordpdf-generation

How to use VBA to change the default MS Word 2016 options so that when you save as PDF the headings are included as bookmarks?


I'm using Microsoft Word 2016 and looking for a way to run a vba macro that will change the default option to Create bookmarks using: Headings when I save a document as PDF when I click on

  1. File ->
  2. Save As ->
  3. PDF (*.pdf) ->
  4. More options.. ->
  5. Options

Create bookmarks using

Note: The option is only available if you have a table of contents in the document.

The goal is that if a user chooses to save as PDF that option will be already checked.


I'm not asking how to do this manually, like in this question

nor programmaticaly save to PDF using vba like here or here.


Solution

  • Since it's not reachable by VBA at the point of save a file as PDF I do not see it as possible to change that PDF saving option using only VBA.

    The only way I see you can reach the behavior you seek is as follow but need some special effort. You need to either create a VTSO addin or be able to have an extra marco file in the Microsoft Word Startup-Path so it will be loaded at Microsoft Word Startup.