Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / August 2006

Tip: Looking for answers? Try searching our database.

Replace Text in Only One Slide?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nillaster@gmail.com - 23 Aug 2006 22:29 GMT
Dear All,

I know that PowerPoint lets you find and replace a text string one
occurrence at a time. There is also a "replace all" function that will
replace all occurrences of a text string. However, is it possible to
replace all occurrences on one slide only? This would speed up my work
considerably.

Thank you,

Jacob
John Wilson - 24 Aug 2006 07:24 GMT
You can with vba

Sub ReplaceText()

Dim strchange As String
Dim strto As String
Dim fromslide As Integer
Dim toslide As Integer
Dim n As Integer
Dim oSld As Slide
Dim oShp As Shape
Dim oTxtRng As TextRange
Dim oTmpRng As TextRange

 
       strchange = InputBox("change")
       strto = InputBox("to")
       fromslide = InputBox("From slide")
       toslide = InputBox("To slide")

For n = fromslide To toslide
Set oSld = Application.ActivePresentation.Slides(n)
   
For Each oShp In oSld.Shapes
Set oTxtRng = oShp.TextFrame.TextRange
Set oTmpRng = oTxtRng.Replace(FindWhat:=strchange, _
Replacewhat:=strto, WholeWords:=True)
Do While Not oTmpRng Is Nothing
Set oTxtRng = oTxtRng.Characters(oTmpRng.Start + oTmpRng.Length, _
oTxtRng.Length)
Set oTmpRng = oTxtRng.Replace(FindWhat:=strchange, _
Replacewhat:=strto, WholeWords:=True)
Loop
Next oShp
Next n
End Sub
Signature

If you dont know how to use vba see here:http://www.pptfaq.com/FAQ00033.htm

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html

> Dear All,
>
[quoted text clipped - 7 lines]
>
> Jacob
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.