使用Excel VBA脚本创建一张幻灯片的PowerPoint。 要将此PPT保存为PDF,请使用以下代码:
objpres.ExportAsFixedFormat Myfile, FixedFormatType:=2, RangeType:=3
这可以正常运行,但是PDF的分辨率差。
为了提高分辨率,我添加了参数PpFixedFormatIntent:= 2 新代码:
objpres.ExportAsFixedFormat Myfile, FixedFormatType:=2, RangeType:=3, PpFixedFormatIntent:=2
添加此参数后,出现编译错误:找不到命名参数
该代码是Excel VBA宏(办公室365)的一部分
激活的参考显示在所附的图像中。
任何人都可以帮忙。 预先感谢。
答案 0 :(得分:2)
参数名称为 Intent ,而不是ppFixedFormatIntent。以下代码没有任何问题:
ActivePresentation.ExportAsFixedFormat "c:\PresentationPDF.pdf", _
ppFixedFormatTypePDF, Intent:=2
这也有效:
ActivePresentation.ExportAsFixedFormat "c:\PresentationPDF.pdf", _
ppFixedFormatTypePDF, ppFixedFormatIntentPrint
不需要RangeType参数。