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
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.
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.
BeforeSave
) of Microsoft Word and provide it via your own Save-Button in the Microsoft Word-Menu described here