Multiple identical forms in one doc

B

billSBS

I am using forms in word2003 to create Report Cards. All the tables have the
same fields with the same formfield names. I need to run macros on some of
the fields.
I have used absolute cell referencing such as:
' Row4, Col2 is the location of the field- Comment
ActiveDocument.Tables(y).Cell(4, 2).Range.Text = CurrentComment
but it deletes the field and replaces it with Protected (uneditable)text.
So I manually renamed each Comment field Comment## where ## is the table
number.
All works OK with CASE structure. Ex:
Case 7
ActiveDocument.FormFields("Comments7").Result = CurrentComment
But the user can specify the number of tables needed so I need the renaming
to be automatic. And there are other fields that need macros.
Is manually renaming all macro-controlled fields the only solution?
Thanks
 
D

Doug Robbins - Word MVP

You cannot apply the same name to multiple formfields. You can probably
achieve the required result without the formfield from being deleted if you
use

ActiveDocument.Tables(y).Cell(4, 2).Range.FormFields(1).Result =
CurrentComment

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
B

billSBS

Thanks Doug, it worked like a charm.

Doug Robbins - Word MVP said:
You cannot apply the same name to multiple formfields. You can probably
achieve the required result without the formfield from being deleted if you
use

ActiveDocument.Tables(y).Cell(4, 2).Range.FormFields(1).Result =
CurrentComment

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
B

billSBS

Doug,
Is there a similar line of code for Captions associated with each table?
I need to be able to change the font of all captions for all tables.
 
D

Doug Robbins - Word MVP

Modify the font in the Style that is used for the Captions.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top