Thursday, May 27, 2010

How to Extract TextBox Contents from All Slides using Powerpoint VBA

Extract Text from Textboxes in Powerpoint slides using VBA

Dedicated to good blogger friend Rahul. This code snippet loops through the slides and extracts the contents of the Textboxes

Sub Extract_TextBox_Text_FromSlides()

Dim oPres As Presentation
Dim oSlide As Slide
Dim oShapes As Shapes
Dim oShape As Shape

Set oPres = ActivePresentation

' --------------------------------------------------
' coded by Shasur for
' --------------------------------------------------

For Each oSlide In oPres.Slides
    Set oShapes = oSlide.Shapes
    For Each oShape In oShapes
        If oShape.Type = msoTextBox Then
            Debug.Print oSlide.Name & vbTab & oShape.TextFrame.TextRange.Text
        End If
    Next oShape
Next oSlide

End Sub


  1. Hi Shasur

    i tried to run the code, but where it is storing the text...

    and one more thing please if you can include that it take only the text which is in italic. otherwise it will give so many unwanted things.

    Thanks a lot

  2. I am Printing it to immediate window. You can replace the Debug.Print with some variable

  3. Anonymous12:33 PM

    Hi Shasur,
    Need to copy the text from the slide textbox of each slide into the notes section of the corresponding slide. Pl. hint on the macro for that.



Share on Facebook
Related Posts Plugin for WordPress, Blogger...
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.