Deleting characters of a given colour

M

Matt

Hello,

I need to make a macro that will clear (delete) characters of a given
colour from the active document.

I have made a macro that clears grey characters:
Application.Run MacroName:="TemplateProject.tw4winClean.Main"
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "?"
.Font.Color = wdColorGray50
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With

Is it possible to make a macro that will display a dialog asking what
colour should be deleted?
E.g.:
- user presses Ctrl+M (for example)
- a dialog is displayed with colours
- user picks a colour (or colours)
- characters of these colours are deleted from the active document

Thank you in advance!!!

Maciej
 
H

Helmut Weber

Hi Matt,

see my answer in the beginners' group.

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 

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