Group:  Microsoft Word ยป microsoft.public.word.vba.beginners
Thread: Underline

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Underline
"mmap" <mmaphqNOSPA[ at ]netzero.net> 31.01.2006 17:51:54
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


RE: Underline
Dave Lett 31.01.2006 18:45:28
Hi,

Are you looking for the following line?

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

HTH,
Dave

"mmap" wrote:

[Quoted Text]
> 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
>
>
>
Re: Underline
"mmap" <mmaphqNOSPA[ at ]netzero.net> 01.02.2006 21:27:49
Bingo that's what we were looking for. THANKS!

"Dave Lett" <DaveLett[ at ]discussions.microsoft.com> wrote in message
news:E92DC006-8CFE-4E75-84F0-113848AA34ED[ at ]microsoft.com...
Hi,

Are you looking for the following line?

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

HTH,
Dave

"mmap" wrote:

[Quoted Text]
> 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
>
>
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net