Dim App As Microsoft.Office.Interop.PowerPoint._Application
Try
App = New Microsoft.Office.Interop.PowerPoint.ApplicationClass
Dim p As Microsoft.Office.Interop.PowerPoint.Presentation = App.Presentations.Open(“.pptxファイルパス”)
For Each e As Microsoft.Office.Interop.PowerPoint.Shape In p.Slides(1).Shapes
Console.WriteLine(e.TextFrame.TextRange.Text)
Next
p.Close
Finally
App.Quit
End Try
Dim ap As New Microsoft.Office.Interop.Powerpoint.Application
Dim fpath As String = "C:\temp\test.pptx"
Dim pr As Microsoft.Office.Interop.Powerpoint.Presentation
Try
pr = ap.Presentations.Open(fpath)
For Each sl As Microsoft.Office.Interop.Powerpoint.Slide In pr.Slides
For Each sh As Microsoft.Office.Interop.Powerpoint.Shape In sl.Shapes
Console.writeLine(sh.TextFrame.TextRange.Text)
Next
Next
pr.Close()
pr = Nothing
Catch ex As Exception
Console.writeLine(ex.ToString)
Throw(ex)
Finally
If Not(pr Is Nothing) Then pr = Nothing
ap.Quit()
ap = Nothing
End Try
Dim ap As New Microsoft.Office.Interop.Powerpoint.Application
Dim fpath As String = "C:\temp\test.pptx"
Dim pr As Microsoft.Office.Interop.Powerpoint.Presentation
Try
pr = ap.Presentations.Open(fpath)
For Each sl As Microsoft.Office.Interop.Powerpoint.Slide In pr.Slides
'For Each sh As Microsoft.Office.Interop.Powerpoint.Shape In sl.Shapes
'Console.writeLine(sh.TextFrame.TextRange.Text)
'Next
Next
pr.Close()
pr = Nothing
Catch ex As Exception
Console.writeLine(ex.ToString)
Throw(ex)
Finally
If Not(pr Is Nothing) Then pr = Nothing
ap.Quit()
ap = Nothing
End Try