Reply
 
Thread Tools Display Modes
  #1   Report Post  
Arlan
 
Posts: n/a
Default What is the best way to make a static reference to a cell in word

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?
  #2   Report Post  
Jezebel
 
Posts: n/a
Default

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?



  #3   Report Post  
Jay Freedman
 
Posts: n/a
Default

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?



  #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?





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 make all the headers/footers use one reference? ibs81 Microsoft Word Help 2 June 14th 05 11:27 PM
SEQ Field not in cross-reference reference type pull-down menu The Josh Microsoft Word Help 5 May 25th 05 02:27 PM
How can I retrieve the format of a header reference? Max Moor Formatting Long Documents 10 May 17th 05 01:22 PM
Cross reference to custom caption type Ton Microsoft Word Help 2 February 9th 05 03:04 PM
How to make reference on the literature source, which is in another file? Leo M. via OfficeKB.com New Users 1 January 27th 05 04:39 PM


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

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"