C
chook.harel
Hi, I have had a working macro that search a text for a string,
then selects the other part of the same sentence and change its font
and size.
The code is as follows:
Sub mac2()
For Each myStoryRange In ActiveDocument.StoryRanges
myStoryRange.Find.Execute FindText:="%%%", Forward:=True
myStoryRange.MoveEnd Unit:=wdParagraph, Count:=1
While myStoryRange.Find.Found
myStoryRange.Font.Name = "David"
myStoryRange.Font.Size = 12
myStoryRange.Find.Execute FindText:="%%%", _
Forward:=True, Format:=True
myStoryRange.Font.Name = "Times New Roman"
myStoryRange.Font.Size = 1
myStoryRange.Find.Execute FindText:="%%%", Forward:=True
myStoryRange.MoveEnd Unit:=wdParagraph, Count:=1
Wend
Next myStoryRange
End Sub
------------------------------
The enclosed macro worked on Windows98SE / Word97. But it doesn't on
XP/Word2003.
Please help me adjust the macro so it will work on the new program.
then selects the other part of the same sentence and change its font
and size.
The code is as follows:
Sub mac2()
For Each myStoryRange In ActiveDocument.StoryRanges
myStoryRange.Find.Execute FindText:="%%%", Forward:=True
myStoryRange.MoveEnd Unit:=wdParagraph, Count:=1
While myStoryRange.Find.Found
myStoryRange.Font.Name = "David"
myStoryRange.Font.Size = 12
myStoryRange.Find.Execute FindText:="%%%", _
Forward:=True, Format:=True
myStoryRange.Font.Name = "Times New Roman"
myStoryRange.Font.Size = 1
myStoryRange.Find.Execute FindText:="%%%", Forward:=True
myStoryRange.MoveEnd Unit:=wdParagraph, Count:=1
Wend
Next myStoryRange
End Sub
------------------------------
The enclosed macro worked on Windows98SE / Word97. But it doesn't on
XP/Word2003.
Please help me adjust the macro so it will work on the new program.