J
JS
Hi All:
I've used a Find&Replace string macro in PPT 2000 for years now without a
problem, but when running PPT 2003 it acts differently. The core of the
macro is:
Set oTmpRng = oTxtRng.Replace(FindWhat:=FindString,
Replacewhat:=ReplaceString, _
MatchCase:=True,
WholeWords:=True)
No problems with PPT 2000, but with 2003 ONLY whole words get replaced. OK,
so I modified my code to be:
If InStr(FindString, " ") > 0 Then ' Is there a space in the Find
string?
Set oTmpRng = oTxtRng.Replace(FindWhat:=FindString,
Replacewhat:=ReplaceString, _
MatchCase:=True)
Else
Set oTmpRng = oTxtRng.Replace(FindWhat:=FindString,
Replacewhat:=ReplaceString, _
MatchCase:=True,
WholeWords:=True)
End If
However, if FindString contains other characters (e.g.: ",.;/?:><~^.....etc)
this does not work (what is the WholeWords rule?)
Also, VBA's help says that WholeWords:= can be msoTriState as below:
-------------------------
MsoTriState can be one of these MsoTriState constants.
msoCTrue
msoFalse Default.
msoTriStateMixed
msoTriStateToggle
msoTrue Find only whole words, and not parts of larger words.
-------------------------
However, I've searched (I believe) high & low for more info on what each of
these options do, but without luck. Could someone please help me out on this
subject?
Thanks in advance, JS
I've used a Find&Replace string macro in PPT 2000 for years now without a
problem, but when running PPT 2003 it acts differently. The core of the
macro is:
Set oTmpRng = oTxtRng.Replace(FindWhat:=FindString,
Replacewhat:=ReplaceString, _
MatchCase:=True,
WholeWords:=True)
No problems with PPT 2000, but with 2003 ONLY whole words get replaced. OK,
so I modified my code to be:
If InStr(FindString, " ") > 0 Then ' Is there a space in the Find
string?
Set oTmpRng = oTxtRng.Replace(FindWhat:=FindString,
Replacewhat:=ReplaceString, _
MatchCase:=True)
Else
Set oTmpRng = oTxtRng.Replace(FindWhat:=FindString,
Replacewhat:=ReplaceString, _
MatchCase:=True,
WholeWords:=True)
End If
However, if FindString contains other characters (e.g.: ",.;/?:><~^.....etc)
this does not work (what is the WholeWords rule?)
Also, VBA's help says that WholeWords:= can be msoTriState as below:
-------------------------
MsoTriState can be one of these MsoTriState constants.
msoCTrue
msoFalse Default.
msoTriStateMixed
msoTriStateToggle
msoTrue Find only whole words, and not parts of larger words.
-------------------------
However, I've searched (I believe) high & low for more info on what each of
these options do, but without luck. Could someone please help me out on this
subject?
Thanks in advance, JS