Hi Jim,
Your answers to the first four questions lead to this (it's all one
statement, broken into separate lines with continuation characters):
ActiveDocument.Sections(2) _
.Footers(wdHeaderFooterPrimary).Range _
.Tables(1) _
.Cell(3, 4).Range _
.Text = rng1
The idea is that you "drill down" through successive layers of the
object model: the document consists of sections, so you choose the
second section; the section has a Footers collection, and you choose
the primary footer; that footer has a range, which in turn contains a
Tables collection...
The answers to the other questions rule out the need for other
complications, such as using the Format function to massage the
appearance of the text.
In formulating a statement like this, it helps to know which objects
contain which collections. But my primary guide in this is the popups
that list all the properties and methods of an object when you type
the period after its name. Also, put the cursor on any of the keywords
and press F1 to see its Help topic, which shows the parent-child
relationships in a little diagram at the top. (That diagram is
clickable and hyperlinks to the topics for those objects.)
Jay,
In answer to your questions:
- Does the document contain more than one section? Yes If so, which section is
the table in? 2
- Is the table in the primary footer, rather than the first-page or
even-page footer? It is a primary footer
- Is it the only table in that footer? Yes
- Which cell should the number be put into? Let's say for talking purposes, the cell is (3, 4). If I am off, I can adjust the number. Is it a particular cell in a
known row and column, or do you have to find it by searching for something. No, I want to delete anything currently in this cell and replace it with the new number. (Actually a string such as T-12555).
(if so, what?) See above.
- Is the variable a number type (Integer, Single, etc.) or a String or a
Variant? String
- Does it need to be formatted in any special way (leading zeros, etc.)? This one has no leading zeros.
- (least important) What's the name of the variable? I think I called it rng1
Jay,
Thanks for the personal attention. I am not used to this. I do appreciate
it. I have been learning word macros one baby step at a time. Figuring out
how to apply the object model is much different from Access or Excel VBA.
Jim