Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / January 2004

Tip: Looking for answers? Try searching our database.

Automation?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wilson Pye - 09 Jan 2004 19:30 GMT
Hi,

I am trying to get the bookmark "Sales Tax" to print with a single under
line.

Here is the code:

oRange = oDocument.Range(0,0)
.InsertAfter( CR )
.InsertAfter( "Sales Tax: " + TAB )
.Collapse( wdCollapseEnd )
oDocument.Bookmarks.Add("SalesTax", oRange)

Any help on the code?

Wilson
Charles Kenyon - 09 Jan 2004 22:56 GMT
Haven't tried it but suggest:

oDocument.Bookmarks("SalesTax").Range.Font.Underline = wdUnderlineSingle

Signature

Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> Hi,
>
[quoted text clipped - 12 lines]
>
> Wilson
Wilson Pye - 10 Jan 2004 15:33 GMT
Charles tried it and no effect on document.
Wilson

> Haven't tried it but suggest:
>
[quoted text clipped - 16 lines]
> >
> > Wilson
Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS - 10 Jan 2004 23:07 GMT
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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.