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 / Programming / October 2005

Tip: Looking for answers? Try searching our database.

How to format a bookmark?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rrawden - 14 Oct 2005 05:22 GMT
I've been trying to add a format to a bookmarked name with no success.  I'm
actually creating a document from the AS/400.  I have a field that currently
prints like xxxxxxxxxxxxxx  I want to have it displayed like this
xxx-xxxx-xxx-xxxx  The bookmark is acctno.  Any suggestions?
Signature

Rita

Jezebel - 14 Oct 2005 10:32 GMT
Word doesn't have any text formatting facility like that, it can only do
numbers; and the format you want is not numeric.

> I've been trying to add a format to a bookmarked name with no success.
> I'm
> actually creating a document from the AS/400.  I have a field that
> currently
> prints like xxxxxxxxxxxxxx  I want to have it displayed like this
> xxx-xxxx-xxx-xxxx  The bookmark is acctno.  Any suggestions?
Doug Robbins - 14 Oct 2005 21:30 GMT
Use the following code:

Dim accountnum As Range, Account As String
With ActiveDocument
   Set accountnum = .Bookmarks("AcctNo").Range
   Account = .Bookmarks("AcctNo").Range.Text
   accountnum.Text = Left(Account, 3) & "-" & Mid(Account, 4, 4) & "-" &
Mid(Account, 8, 3) & "-" & Right(Account, 4)
   .Bookmarks.Add Name:="AcctNo", Range:=accountnum
End With

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> I've been trying to add a format to a bookmarked name with no success.
> I'm
> actually creating a document from the AS/400.  I have a field that
> currently
> prints like xxxxxxxxxxxxxx  I want to have it displayed like this
> xxx-xxxx-xxx-xxxx  The bookmark is acctno.  Any suggestions?

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.