Hi all,
Basically, I want to run a macro that will search for the keyword and move the cursor to the first occurence within the text body.
In Word, I was able to do this easily thanks to the Macro Recorder. However, this was not possible in Powerpoint since no recorder is available.
As I searched in the Help section, I found the code to find the keyword, as below:
What this code does is to find the occurences of the keyword in the text, make them bold but the mouse cursor is still at the first page.
Please help me point out what I need to modify to move the cursor to the first occurence of the keyword being found.
Any input is greatly appreciated. Thank you so much in advance.
-D
Basically, I want to run a macro that will search for the keyword and move the cursor to the first occurence within the text body.
In Word, I was able to do this easily thanks to the Macro Recorder. However, this was not possible in Powerpoint since no recorder is available.
As I searched in the Help section, I found the code to find the keyword, as below:
Code:
Sub searchMacro()
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
End Sub
Please help me point out what I need to modify to move the cursor to the first occurence of the keyword being found.
Any input is greatly appreciated. Thank you so much in advance.
-D
Comment