Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to deal with bookmarks within a table? 1

Status
Not open for further replies.

marcello62

Technical User
Jun 19, 2006
42
NL
Hi there,

I use vba code from an ms access code module to format bookmarks in a word document.

Therefore I use the following code:

doc.Bookmarks("mv5_5").Select
Selection.Font.ColorIndex = wdRed
Selection.Font.Bold = True

This works fine for most of the bookmarks, but for bookmarks within a table it does not work.
and I get the error code "462, the remote server machine does not exist or is unavailable".
When I use the resume next statement in the error handler the code runs, but the bookmarks in the table
are not formatted as specified by above code.

So my question is how to programmatically access bookmarks within the cells of a table.
Any help will be greatly appreciated.
 
Since this is more a Word VBA question, you may have a better luck asking your question in forum707

BTW - don't you have to fully qualify your doc object this way....?
[pre]
With doc
.Bookmarks("mv5_5").Select
.Selection.Font.ColorIndex = wdRed
.Selection.Font.Bold = True
End With[/pre]
I usually format my bookmarks when I create them in Word, so I don't format them in code.


---- Andy

There is a great need for a sarcasm font.
 
I guess you are right about the fully qualifying the bookmarks, it's better practice, but this code works outside the tables.
Formatting the bookmarks would not help because the colors and the bold property I set are dependent on conditions which I test in the code.
I'll repost my question in the VBA section and I'll see what I can find there, thanx for the advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top