如果打开ppt后,还需要对它进行操作,可以用office interop:
先引入两个.net组件:在项目上点右键,添加引用:
Office
Microsoft.Office.Interop.Powerpoint
添加完成后,就可以写代码操作了:
Dim app As New Microsoft.Office.Interop.PowerPoint.Application
app.Visible = True
Dim ppt As Microsoft.Office.Interop.PowerPoint.Presentation
ppt = app.Presentations.Open("xxxx.pptx")
Dim slides As Microsoft.Office.Interop.PowerPoint.Slides
slides = ppt.Slides