[英]C# convert .ppt to images
我正在嘗試使用 C# 將 .ppt 文件轉換為圖像集合。
我正在使用以下代碼:
using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;
.....
Microsoft.Office.Interop.PowerPoint.Application app = new Microsoft.Office.Interop.PowerPoint.Application();
Presentation pres = app.Presentations.Open(@"C:\Users\XYZ\Desktop\Presentation.ppt", MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse);
pres.SaveAs(@"C:\Users\XYZ\Desktop\", PpSaveAsFileType.ppSaveAsJPG, MsoTriState.msoFalse);
pres.Close();
我收到以下異常:
Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
在線:
Microsoft.Office.Interop.PowerPoint.Application app =
new Microsoft.Office.Interop.PowerPoint.Application();
是否需要安裝完整版的 Office 2010 才能使此代碼正常工作(我只安裝了 Powerpoint Viewer)或者是否有其他解決方案來解決此異常?
您需要安裝完整的 PowerPoint 才能實現此目的。 查看器無法操作 PowerPoint 文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.