Copying Rows with Form Fields

J

Jamie

I’m working in Word 2003. I’m creating a template with a table and form
fields. The table make up is this:

1st row has 4 columns
Date: (text in column 1) – form field (column 2) – Client Name: (text in
column 3) – form field (column 4)

2nd row has 4 columns:
Referred To: (text in column 1) – form field (column 2) – Follow-Up Date:
(text in column 3) – form field (column 4)

3rd row has 1 column:
Comments: form field

I would like to attach an on exit macro to the Comments form field that asks
the user if they would like to add another client. If they click on Yes, the
document would unlock and all three rows are copied with the form fields –
however, the form fields need to be blank. Once copied the template would
lock again.

The user may need to do this many times; add clients.

Any help you can provide is appreciated. Thanks.
 
J

Jay Freedman

I’m working in Word 2003. I’m creating a template with a table and form
fields. The table make up is this:

1st row has 4 columns
Date: (text in column 1) – form field (column 2) – Client Name: (text in
column 3) – form field (column 4)

2nd row has 4 columns:
Referred To: (text in column 1) – form field (column 2) – Follow-Up Date:
(text in column 3) – form field (column 4)

3rd row has 1 column:
Comments: form field

I would like to attach an on exit macro to the Comments form field that asks
the user if they would like to add another client. If they click on Yes, the
document would unlock and all three rows are copied with the form fields –
however, the form fields need to be blank. Once copied the template would
lock again.

The user may need to do this many times; add clients.

Any help you can provide is appreciated. Thanks.

Set up the three rows with empty form fields, select them, and store them as an
AutoText entry in the form's template. In the exit macro, unprotect the
document, insert the AutoText in the paragraph immediately after the table
(which makes it part of the table), remove the exit macro from the previous
comment field and add it to the new comment field, and reprotect.

There is one caveat: AutoText can only be stored in a template, not in a
document. If you're going to be sending this form to other computers, make the
form itself a template (.dot) file so the AutoText doesn't get separated from
the form.

If you want coding help, ask in one of the Word VBA newsgroups.
 
J

Jamie

Hi Jay, I highlighted the rows and created an Auto Text entry, but I am
unsure as how to have the auto text entry run as an on exit macro. I would
like the copying and pasting of the rows and form fields to be a seemless
process like a macro, not inserted as auto text. I'll follow your
suggestion and post in another newsgroup.

Thanks
 

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