Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
tack tack is offline
external usenet poster
 
Posts: 2
Default vba get table's object from bookmark

using VBA;

I have serveral tables in a doc. One of the tables has a bookmark in one of
its cells. How can I go from a bookmark to get the table reference the
bookmark is in? Better yet would be a cell reference that I could also use to
get the table reference.

Using doc.Application.Selection.Information(W.WdInformat ion.wdWithInTable)
only tells me that the bookmark is in a table, not which table.

Thanks
  #2   Report Post  
Posted to microsoft.public.word.tables
Jezebel Jezebel is offline
external usenet poster
 
Posts: 1,384
Default vba get table's object from bookmark

[range].Tables(1)

this returns a reference to the table that includes the range. The range can
be the selection, or the contents of a cell, or any range at all, eg

set pTable = activedocument.Bookmarks("mybm").Range.Tables(1)


Be aware that there are complications if you have nested tables.


"tack" wrote in message
...
using VBA;

I have serveral tables in a doc. One of the tables has a bookmark in one
of
its cells. How can I go from a bookmark to get the table reference the
bookmark is in? Better yet would be a cell reference that I could also use
to
get the table reference.

Using doc.Application.Selection.Information(W.WdInformat ion.wdWithInTable)
only tells me that the bookmark is in a table, not which table.

Thanks



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I group a caption and object (figures and tables)? Julia Microsoft Word Help 1 October 17th 06 08:53 AM
My noteref to valid bookmark says "Error! Bookmark not defined."? jchilders_98 Microsoft Word Help 3 October 5th 06 02:23 PM
Insert a bookmark field [email protected] Microsoft Word Help 4 September 26th 06 04:34 PM
Auto-numbering bug in tables - Word 2003 mtnbutterfli Tables 2 June 22nd 06 01:10 PM
"Word was unable to open the Excel data source" Asp.net Mailmerge Shalini Mailmerge 8 June 23rd 05 02:09 AM


All times are GMT +1. The time now is 12:22 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"