vbams-accessms-wordexport-to-pdf

Why is the font changed when exporting a word-file to pdf?


We use this code in access-vba to convert our word to a pdf:

    Set w_app = CreateObject("word.application")
    w_app.Documents.Open(fileName:="C:\Temp\Test.docx")
    w_app.ActiveDocument.ExportAsFixedFormat "c:\Temp\test.pdf", wdExportFormatPDF, _
                                             OpenAfterExport:=False, OptimizeFor:=wdExportOptimizeForPrint, _
                                             Range:=wdExportAllDocument, From:=1, To:=1, item:=wdExportDocumentContent, _
                                             IncludeDocProps:=True, KeepIRM:=True, CreateBookmarks:=wdExportCreateNoBookmarks, _
                                             DocStructureTags:=True, BitmapMissingFonts:=True, useIso19005_1:=false

But when we open the pdf, all the text which was written with the font: "Apercu Pro" has changed to the font: "Segoe Script".

This does not happen when we use Office-Word to manually export the file.

Strangly, it also does work fine when the font "Apercu Pro" in !not! installed in windows.

What we already tried:


Solution

  • I did not really find out what the problem was exactly but my solution was to deinstall the .otf-Version (OpenType format) of the font and instead install the .ttf-Version (True type format).