Att: Helmet. Search changes font size.

D

Dave Neve

Hi

I asked a question last week and I have since managed to tidy up my macros
as I was no longer sure whether the macros assigned to 'new macros' or 'this
document' or referenced to the .dot was the macro which was running when I
clicked on my tool bar.

So I can now say with certainty that the macro below is the 'guilty' macro.

When searching for words, it changes the font size which might be
16, 14, 12, 10 , for a four lettered word (falling tone) to 12,12,12,12,
(normal font size which I happen use for flat tones).

This possibly didn't show up in my question if you don't allow .html.

Any ideas which line could be doing this?

Thanks

Sub Highlight()
Dim sSrc As String
Options.DefaultHighlightColorIndex = wdYellow
sSrc = Selection.Text
Resetsearch
Selection.SelectColumn
With Selection.Find
.Text = sSrc
.Replacement.Text = sSrc
.Replacement.Highlight = True
.MatchWholeWord = True ' or true if you like
.Wrap = wdFindStop ' !!!
.Execute Replace:=wdReplaceAll
End With
Resetsearch
End Sub

Sub Resetsearch()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
End Sub
 
H

Helmut Weber

Hi Dave,
did you try the alternative I posted on Nov 12th?
Besides that, both approaches do work here and now.
Kind of hard to trap an error or misbehaviour,
if it doesn't show.
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 

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