A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Copying Rows with Form Fields



 
 
Thread Tools Display Modes
  #1  
Old February 15th, 2008, 12:45 AM posted to microsoft.public.word.tables
Jamie
external usenet poster
 
Posts: 317
Default Copying Rows with Form Fields

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.

--
Jamie
  #2  
Old February 15th, 2008, 01:43 AM posted to microsoft.public.word.tables
Jay Freedman
external usenet poster
 
Posts: 9,488
Default Copying Rows with Form Fields

On Thu, 14 Feb 2008 16:45:01 -0800, Jamie
wrote:

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.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
  #3  
Old February 15th, 2008, 05:00 PM posted to microsoft.public.word.tables
Jamie
external usenet poster
 
Posts: 317
Default Copying Rows with Form Fields

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
--
Jamie


"Jay Freedman" wrote:

On Thu, 14 Feb 2008 16:45:01 -0800, Jamie
wrote:

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.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.