Yes, you need more code to do anything more than just going to the text.
The version you showed in one of your posts has the line
Selection.MoveLeft Unit:=wdCharacter, Count:=1
after the .Execute. That moves the cursor to the left of the italic text. If
you leave the cursor there, the next Find is going to find the same piece
again -- you have to start the next search *after* the end of the first
italic text.
This might be easier to do with a Replace instead of a Find, then you can
just do one Replace All and be done. If you tell me exactly how you "mark"
the text, I can probably come up with a do-it-all macro.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Post by LizWSpoke too soon.
It finds one italicized item but when I try to get it to find the
next one, it stays in place. I have to manually move it after to get
it to find the next, with varying results. We need to search for
italics throughout the document and I was hoping to hit Alt I to find
the first, mark it, and then hit Alt I again to find the next
instance.
Is there extra code I have to put in for that?
Thanks again.
Post by Jay FreedmanPost by LizWHi there,
We didn't have any luck with the Tools, Macro Record feature when
trying to find italics with the find dialog box. The macro won't run.
Is there a way to do it in VBA?
Hi Liz,
The braindead recorder is sometimes completely worthless. In this
case, it records the fact that you're looking for formatting, but it
forgets to record what kind of formatting you asked for!
Press Alt+F8 to open the list of macros, select the name you gave to
the recorded macro, and click the Edit button. In the editor, you'll
Sub FindItalic()
'
' FindItalic Macro
' Macro recorded 11/23/2004 by ...
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End Sub
.Font.Italic = True
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org