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 http://vbadud.blogspot.com
' --------------------------------------------------

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

5 comments:

  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
    Regards
    Rahul

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

    ReplyDelete
  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.

    Rgds,
    Murugan

    ReplyDelete
  4. Your work is very good and I appreciate you and hopping for some more informative posts. Thank you for sharing great information to us. Extract pictures from microsoft word

    ReplyDelete
  5. Hi I want to take list of all slides and into the new slide at shape 2 Any one can help me?

    ReplyDelete

StumbleUpon
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.