Charles tried it and no effect on document.
Wilson
Hi Wilson,
Use
Dim oDocument As Document, oRange As Range
Set oDocument = ActiveDocument
Set oRange = oDocument.Range(0, 0)
oRange.InsertAfter vbCr & "Sales Tax: " & vbTab
Set oRange = oDocument.Paragraphs(2).Range
oRange.End = oRange.End - 2
oDocument.Bookmarks.Add "SalesTax", oRange
oRange.Font.Underline = wdUnderlineSingle
If you want the Tab space to be included in the bookmark (which is redundant
as far as applying the underline is concerned) and to be underlined, delete
the third last line.
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
> Charles tried it and no effect on document.
> Wilson
[quoted text clipped - 20 lines]
>> >
>> > Wilson
Wilson Pye - 12 Jan 2004 20:18 GMT
Hi Doug,
I tried:
.InsertAfter( CR )
.InsertAfter( "Sales Tax: " + TAB)
.Collapse( wdCollapseEnd )
.InsertAfter( TAB )
.Underline = wdUnderLineSingle
oDocument.Bookmarks.ADD("SalesTax", oRange)
.Collapse( wdCollapseEnd )
and it seems to work ok, your code also works.
Is one any better... I honestly am so very much a beginner at this.
Wilson
You seem very knowledgeable, can you take a peak at my posting re:
"automation and mail merge?"
Thanks so much!
Wilson
> Hi Wilson,
>
[quoted text clipped - 42 lines]
> >> >
> >> > Wilson