如何在 PowerPoint 中使用 .PasteSpecial 方法将从 Excel 复制的图表作为 SVG 插入?

How to insert chart copied from Excel with .PasteSpecial method in PowerPoint as SVG?

我正在使用以下代码从 Excel 复制图表:

oChartObject.Chart.CopyPicture(Excel.XlPictureAppearance.xlScreen, Excel.XlCopyPictureFormat.xlPicture)

现在我想将此图表作为 SVG 图像插入到 PowerPoint 中。我正在使用 .PasteSpecial 但 PpPasteDataType 枚举似乎不接受 SVG (https://docs.microsoft.com/en-us/office/vba/api/PowerPoint.View.PasteSpecial)

mySlide.Shapes.PasteSpecial(PowerPoint.PpPasteDataType.SeeWebLinkToMicrosoft)

但是在 PowerPoint 中手动调用特殊粘贴对话框时,我可以选择将 Excel 中的图像粘贴为 SVG(见屏幕截图)。

我的问题:如何将从 Excel 复制的图表作为 SVG 粘贴到 PowerPoint?

SVG 是 Office 中一种相对较新的格式。它尚未添加到 VBA 对象模型中。相反,请尝试使用 ppPasteEnhancedMetafile。此粘贴为 EMF,一种 Microsoft 更好支持的矢量格式。