You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Word转PDF字体变更问题:Access-VBA代码异常排查

问题:VBA批量转换Word到PDF时字体替换异常

我们使用以下Access-VBA代码将Word文档转换为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

但生成的PDF中,所有使用Apercu Pro字体的文本都变为Segoe Script字体。手动通过Office Word导出则无此问题,且当Windows未安装Apercu Pro字体时,代码转换也正常。

我们已尝试以下方案:

  • 修改ExportAsFixedFormat的所有参数→无效果
  • 改用ExportAsFixedFormat2替代ExportAsFixedFormat→无效果
  • 改用w_app.ActiveDocument.SaveAs2("c:\Temp\test.pdf", EmbedTrueTypeFonts:=False)替代ExportAsFixedFormat→无效果

内容的提问来源于stack exchange,提问作者Gener4tor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 22:01:01