VBA to replace marching red ants with yellow highlight?

S

stir-crazy

Hi all,

I'm exploring VBA for Excel, learning a lot. But have even further to go
with word. I'm editing specifications, and to "make it easy" on the person I
need to send these back to, I set the font of all areas I needed input on to
"Marching Red Ants".

The problem is, is this guy is very old school, and a dinosaur of the days
of ink and paper. So I now need to print these up and give them to him. I
have dozens of documents with sporadic modifications done; selecting each
section of Marching Red Ants would be more tedious than when I first put them
there.

Can you point me in the right direction of what the scipt ought to be, or
better yet, post it here? Thanks!
 
J

Jean-Guy Marcil

stir-crazy was telling us:
stir-crazy nous racontait que :
Hi all,

I'm exploring VBA for Excel, learning a lot. But have even further
to go with word. I'm editing specifications, and to "make it easy"
on the person I need to send these back to, I set the font of all
areas I needed input on to "Marching Red Ants".

The problem is, is this guy is very old school, and a dinosaur of the
days of ink and paper. So I now need to print these up and give them
to him. I have dozens of documents with sporadic modifications done;
selecting each section of Marching Red Ants would be more tedious
than when I first put them there.

Can you point me in the right direction of what the scipt ought to
be, or better yet, post it here? Thanks!

Here is a little something to get you going...

'_______________________________________
Dim docSource As Document
Dim docNew As Document
Dim rgeDoc As Range

Set docSource = ActiveDocument
Set docNew = Application.Documents.Add
Set rgeDoc = docNew.Range

With docSource.Range.Find
.Text = ""
.Font.Animation = wdAnimationMarchingRedAnts
Do While .Execute
rgeDoc.InsertAfter .Parent.Text & vbCrLf
Loop
End With
'_______________________________________

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
H

Helmut Weber

Hi,

for the highlighting part of your question.

Sub Test8223()
Dim rDcm As Range
Set rDcm = ActiveDocument.Range
With rDcm.Find
.Font.Animation = wdAnimationMarchingRedAnts
While .Execute
rDcm.HighlightColorIndex = wdYellow
Wend
End With
End Sub

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
S

stir-crazy

Jean-Guy, Helmut,

Thank you! This looks great; can't wait to try it out. I greatly
appreciate the input from you both!
 

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