B
Brian Beck
I have a particular form that goes through occasional revisions and
frequently people submit older versions of the form, rather then the newest
one. I've written a macro to read in the data from all the form fields on
an older form, store that data in variables, open up a new copy of the
latest form template, and then assign the variables to their respective form
fields in the new form. This works great, with a few exceptions:
-I have a Boolean form field that assigns to a variable with no problem.
However, assigning that variable value to the Boolean form field on the new
form is proving difficult. I've tried (where vDTCSameAsSubmitter is the
stored value of the "DTCSameAsSubmitter" form field from the older form)
If vDTCSameAsSubmitter Then
ActiveDocument.FormFields("DTCSameAsSubmitter").Result = True
but that doesn't seem to assign anything to the form field. Similarly if I
try
ActiveDocument.FormFields("DTCSameAsSubmitter").Result =
vDTCSameAsSubmitter
it still seems like nothing gets assigned to the form field. I've inserted
MsgBoxes to show the value of the form field at various times, and it is
constantly "0".
How can I get this variable properly assigned to the form field?
Additionally, there are 2 form fields that contain dates. When there is a
value in the field of the old form, it copies over just fine to the new one.
However, if the field is blank then Word ends up putting the current date
into the form field on the newly created form. I read in the data from the
old form like this:
If ActiveDocument.FormFields("Contact_Date").Result <> "" Then
vContactDate = ActiveDocument.FormFields("Contact_Date").Result
End If
and then assign the variable to the form field on the newly created form
like this:
ActiveDocument.FormFields("Contact_Date").Result = vTEAContactDate
How can I get the macro to simply leave the form field blank on the new form
if there was nothing in that same form field on the old form?
Thanks in advance for any help!
-Brian
frequently people submit older versions of the form, rather then the newest
one. I've written a macro to read in the data from all the form fields on
an older form, store that data in variables, open up a new copy of the
latest form template, and then assign the variables to their respective form
fields in the new form. This works great, with a few exceptions:
-I have a Boolean form field that assigns to a variable with no problem.
However, assigning that variable value to the Boolean form field on the new
form is proving difficult. I've tried (where vDTCSameAsSubmitter is the
stored value of the "DTCSameAsSubmitter" form field from the older form)
If vDTCSameAsSubmitter Then
ActiveDocument.FormFields("DTCSameAsSubmitter").Result = True
but that doesn't seem to assign anything to the form field. Similarly if I
try
ActiveDocument.FormFields("DTCSameAsSubmitter").Result =
vDTCSameAsSubmitter
it still seems like nothing gets assigned to the form field. I've inserted
MsgBoxes to show the value of the form field at various times, and it is
constantly "0".
How can I get this variable properly assigned to the form field?
Additionally, there are 2 form fields that contain dates. When there is a
value in the field of the old form, it copies over just fine to the new one.
However, if the field is blank then Word ends up putting the current date
into the form field on the newly created form. I read in the data from the
old form like this:
If ActiveDocument.FormFields("Contact_Date").Result <> "" Then
vContactDate = ActiveDocument.FormFields("Contact_Date").Result
End If
and then assign the variable to the form field on the newly created form
like this:
ActiveDocument.FormFields("Contact_Date").Result = vTEAContactDate
How can I get the macro to simply leave the form field blank on the new form
if there was nothing in that same form field on the old form?
Thanks in advance for any help!
-Brian