Results 1 to 3 of 3

Thread: How to find a particular text in powerpoint

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    12

    How to find a particular text in powerpoint

    Hi,

    Is there any possibility of finding a particular text in a powerpoint presentation file and it should return me in which slide the finding text is present.

    Thankz,
    Raj

  2. #2
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: How to find a particular text in powerpoint

    Hi,

    This post is related to MS Power Point (Office Development, aka VBA). So you need to post it in Office Development Forum. So that you will get quick responses. Anyway here is the solution for your question:

    VB Code:
    1. 'This example finds every occurrence of "Friend" in the active presentation and
    2. 'returns the slide number.
    3. Dim sld As Slide
    4. Dim shp As Shape
    5. Dim txtRng As TextRange
    6. Dim foundText As TextRange
    7. For Each sld In Application.ActivePresentation.Slides
    8.     For Each shp In sld.Shapes
    9.         If shp.HasTextFrame Then
    10.             Set txtRng = shp.TextFrame.TextRange
    11.             Set foundText = txtRng.Find(FindWhat:="Friend")
    12.             Do While Not (foundText Is Nothing)
    13.                 With foundText
    14.                     'Debug.Print sld.Name
    15.                     Debug.Print sld.SlideIndex
    16.                     Exit For
    17.                 End With
    18.             Loop
    19.         End If
    20.     Next
    21. Next
    CS

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to find a particular text in powerpoint

    Moved to Office Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width