underlining the word but not the ":" at the end

G

Guest

I am trying to just underline the a word inside a text document. I do not
want spaces underlines so I went to Format, Font and on the Font tab for
Underline style I selected Words only and this works great, but is it
possible to not have the colon at the end of a word underlined. I am running
Word2003, latest office patches applied.

Thanks.
 
G

Greg Maxey

I think that is just the way it is. If you want a work around, I think you
will need some a macro.

Sub UnderlineJustWordsAndLeaveEndingPuctuationBe()
Dim aWord As Word.Range
Dim oRng As Range

Set oRng = Selection.Range
'Set oRng = ActiveDocument.Range

For Each aWord In oRng.Words
aWord.Font.Underline = wdUnderlineWords
Next
End Sub

As is, the code acts on the selected text. Unstet 'Set oRng =
ActiveDocument.Range to act on the entire document.
 

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