Tech Support Forum banner
Status
Not open for further replies.

Auto-populate a MS Word table cell with text from a diff cell?

1 reading
43K views 5 replies 2 participants last post by  dreamrthts  
#1 ·
I have a table in Microsoft Word with three columns. Is it possible to "program" the cells of the 2nd and 3rd columns to contain exactly the same text from the cells of the 1st column? I'm looking for a way to do this without copying and pasting. The 1st column will be updated frequently, and the 2nd and 3rd need to automatically update themselves to match. Is this something I would use cell References for? I'm unfamiliar with how they work. Thanks.
 
#2 ·
Hi dreamrthts,

Unfortuantely, Word field referencing (which is what you might otherwise expect to work like Excel formulae) won't pick up the text from another cell - only the numbers.

You could bookmark the text (not the cell) and insert a cross-reference to the text. That way, if you update the bookmarked text, a simple print preview should be enough to update the cross-references (make sure 'update fields' is checked under Tools|Options|Print). The problem with using bookmarks is that they're all too easy to delete by accident.

A different approach that might work for you is to create a set of Custom Document Properties (File|Properties|Custom), which you'd update instead of updating the cells in a particular table. Then, anywhere (it doesn't have to be a cell) you want the string to appear, you'd insert a DOCPROPERTY field (Insert|Field) pointing to the particular Custom Document Property. Again, a Print Preview should be enough to update the field references.
 
Save
#3 ·
Thanks, macropod. The Custom Document Properties sounds like the way to go. Am I understanding this right to say I can "load" a custom doc property into whatever cell I have a DOCPROPERTY field in, that points to that particular doc propery? Seems much like how you would load a .txt file into an html page, so that in order to update the page, you only need update the .txt file.

• I'm unfamiliar with Custom Document Properties. I've chosen a Name, and set the Type to "Text." Do I put the text I want to appear in the Value field?

• I'm also unfamiliar with Fields. How do I point one to the particular Custom Document Property?

Much thanks.
 
#5 ·
Hi dreamrthts,

Custom Document Properties can be created along the lines you suggest - assign a name, then populate the named property with a string (eg Name: Prop1; String: "The quick brown fox jups over the lazy dog."). The simplest way (IMHO) to insert the string associated with this Custom Document Property into the document is to select the point where the string is to appear, press Ctrl-F9 to create a pair of field braces (ie '{}'), then type 'DOCPROPERTY Prop1' between the field braces (ie '{DOCPROPERTY Prop1}'), then press F9. If you want to change the displayed result, wherever it appears in the document, simply change the property's string, then select the whole document (Ctrl-A) then press F9 to update the fields.

As for the formatting issue, the whole field can only have one format - usually that of the underlying paragraph Style, though you can add a Charformat switch to the field so that a different format can be used.
 
Save
#6 ·
Thanks! I've successfully tried both methods you've suggested here. Ultimately I've settled on the more fragile bookmarks with cross-references, simply because there needs to be special formatting I won't be able to do with properties.

Really appreciate the help! Very good-to-know stuff.
 
Status
Not open for further replies.
You have insufficient privileges to reply here.