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
Printable View
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
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:
'This example finds every occurrence of "Friend" in the active presentation and 'returns the slide number. Dim sld As Slide Dim shp As Shape Dim txtRng As TextRange Dim foundText As TextRange 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:="Friend") Do While Not (foundText Is Nothing) With foundText 'Debug.Print sld.Name Debug.Print sld.SlideIndex Exit For End With Loop End If Next Next
Moved to Office Development