The latest version of Office 365 allows for this with the CreateBookmarks argument.
Microsoft Documentation: https://learn.microsoft.com/en-us/office/vba/api/word.document.exportasfixedformat
Example VBA Code:
ActiveDocument.ExportAsFixedFormat _
OutputFileName:= "#######Filepath#########", _
ExportFormat:=wdExportFormatPDF, _
CreateBookmarks:=wdExportCreateHeadingBookmarks