Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to extract image from pptx document and save it in my desktop
Imports Microsoft.Office.Interop.PowerPoint

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ppt As New Presentation()
        ppt.LoadFromFile("Desktop\test.pptx")

        For i As Integer = 0 To ppt.Images.Count - 1
            Dim image As Image = ppt.Images(i).Image
            image.Save(String.Format("Desktop\Images{0}.jpg", i))
        Next
    End Sub
End Class



but i have error in this line

Dim ppt As New Presentation()


cannot declare ppt


Error	1	'Microsoft.Office.Interop.PowerPoint.PresentationClass.Friend Sub New()' is not accessible in this context because it is 'Friend'.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900