【发布时间】:2015-02-05 12:24:45
【问题描述】:
自 2014 年 3 月以来,我正在开发一个 PowerPoint 提取工具,该工具从 PowerPoint 中提取单词或段落并将其写入 Word 文档。它已被开发。在测试期间。我们发现 数学方程式 没有从 PowerPoint 幻灯片中提取。 我正在使用 Microsoft.Office.Interop.Powerpoint.dll 库。我正在阅读如下文件。
var powerPoint = new Application {WindowState=PpWindowState.ppWindowMinimized};
var oPresSet = powerPoint.Presentations;
Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(pptName, MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
var str = oPres.Slides[1].NotesPage.Shapes[2].TextFrame.TextRange.Text;
这是输入PPT的截图。
但我想阅读 PowerPoint 幻灯片中的数学方程式。 我尝试使用这些 MathZones 和 get_MathZones,但我对如何使用 MathZones proerety 了解不多。另一方面,get_MathZones 方法给出相同的乱码文本。我使用了 get_MathZones 方法,如下所示。
var strObj = oPres.Slides[1].NotesPage.Shapes[2].TextFrame2.TextRange.MathZones.get_MathZones();
var str = strObj.Text;
这是 ppt 输出为乱码的屏幕截图。
我只想从 PowerPoint 中读取 数学方程式,然后想以编程方式将其写入 Word 文档。首先,我无法阅读数学方程式。建议我任何解决方案。
【问题讨论】:
-
如何在c#中使用?
-
我们可以通过编程方式使用 MS office 数学方程吗?
标签: c# math ms-office powerpoint office-interop