Finding and Replacing using macro

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.
 
C

chook.harel

Your right, my bad.
The problem is that it can change the font but not the font size,
instead it changes it where there is several types (like Latin1 20pt)
or something like that ..
(Not the place where u usually change the size)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top