View Single Post
  #4   Report Post  
Jezebel
 
Posts: n/a
Default

Good points. Other methods --

-- Using the Table's ID property to link to additional information in a
collection class. You have to reconstruct the collection each time you open
the document, since table IDs aren't saved.

-- Putting a tag, as hidden text, in the table header.

As you suggested last time, it would be a lot easier to make suggestions if
we had some guidance as to the point of the exercise.


"Jay Freedman" wrote in message
...
Well, there isn't one in the general case, but you may be able to do
something for the specific case if you can define some criterion to
identify the right location.

The criterion is going to depend critically on how your template is
constructed and what you let your users do. If the template creates a
protected form, you can be pretty sure (unless your users are the
destructive hacker type) that they aren't going to add or delete
tables, so you could use a reference like
ActiveDocument.Tables(3).Cells(2,3).Range. Or you could try enclosing
the entire table in a bookmark, which is less likely to be
accidentally deleted, and then refer to
ActiveDocument.Bookmarks("MyTable").Tables(1).Cell s(2,3).Range.

If you can't do something like that, maybe there's a constant
table-column heading that you can use as the search text in a .Find
operation. If you find it, then navigate the table from there.

Whatever scheme you use, be sure to error-trap your code to handle (as
gracefully as possible) the case when you can't locate the right cell.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

On Sun, 19 Jun 2005 12:18:28 +0930, "Jezebel"
wrote:

Word documents are inherently dynamic, so you're right: there isn't one.


"Arlan" wrote in message
...
As bookmarks are possible to erase as a word table cell is edited
(Thanks
for
the info Jay!) what is a good alternative to create a static reference
to
particular cells in a word table? Or is there one?