Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA: PowerPoint

Status
Not open for further replies.

Deeppurple

Programmer
Jan 17, 2003
16
IN
Hi all,
I am trying read the slides of a powerpoint presentation. I want to search for particular words in the powerpoint presentation comprising of 'n' slides. How to read thru the all the slides?

-TIA
 
Not sure why your question, unless you are specifically looking for a macro; which I believe can be recorded. I use PPT2K and had no problen with find and repalce dialog box that cycled through every slide. In love with Irene Jacob. Wife knows about it, Irene doesn't.
 
I tried recording a macro, but to my disappointment the macro threw up a blank. Never mind below is a piece of code that works fine
Code:
For Each sld In Application.ActivePresentation.Slides
    For Each shp In sld.Shapes
        If shp.HasTextFrame Then
            Set txtRng = shp.TextFrame.TextRange
            Set foundText = txtRng.Find(FindWhat:="CompanyX")
            Do While Not (foundText Is Nothing)
                With foundText
                    .Font.Bold = True
                    Set foundText = _
                        txtRng.Find(FindWhat:="CompanyX", _
                        After:=.Start + .Length - 1)
                End With
            Loop
        End If
    Next
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top