Selection, Color and Bold.

R

Robert

I would like in a macro to add Bold, Red parentheses to a
Selection consisting of 3-4 contiguous words which must
remain in Black and unBolded. InsertBefore/After position
the parentheses well, but color the whole text also
(which must not happen.) Any formatting to correct this
results in the parentheses taking on the same color, as
the Selection displays the last formatting it receives. I
cannot find any Method which allows me to add color (etc)
to the ends of the Selection without the Selection being
automatically extended. I have also tried collapsing the
Selection and using TypeText, but without success.

Can anyone help please?
 
C

Chad DeMeyer

Robert, please try this:

Selection.InsertBefore "("
With Selection.Characters(1).Font
.Bold = True
.Color = wdColorRed
End With
Selection.InsertAfter ")"
With Selection.Characters(Selection.Characters.Count).Font
.Bold = True
.Color = wdColorRed
End With

This will also work if applied to a Range object, which is preferable to
working with Selection.

Regards,
Chad
 

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