Underline

M

mmap

We have a bookmark that we underline as follows:
.Bookmarks("proj_coord").Range.Font.Underline = True

That underlines the complete bookmark. However, when we enter the text into
the bookmark it still underlines the spaces. Here is the code we use the
following procedure:

Public Sub differentreplacebookmarktext(strBkmk As String, strRep As String)
Dim Bmrange As Range
Set Bmrange = ActiveDocument.Bookmarks(strBkmk).Range
Bmrange.Text = strRep
ActiveDocument.Bookmarks.Add strBkmk, Bmrange
End Sub

Where strbkmk is the bookmark name & strrep is the text to enter into the
bookmark.

What can we do to NOT underline the remaining spaces? TIA
 
D

Dave Lett

Hi,

Are you looking for the following line?

ActiveDocument.Bookmarks("proj_coord").Range.Font.Underline = wdUnderlineWords

HTH,
Dave
 
M

mmap

Bingo that's what we were looking for. THANKS!

Hi,

Are you looking for the following line?

ActiveDocument.Bookmarks("proj_coord").Range.Font.Underline =
wdUnderlineWords

HTH,
Dave
 

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