Hi

Request some help in automating a form in word. I need to create form
which would be sent as an email to users. This form would accept
numerical data in combo boxes from the users. Then average result
needs to be calculated and stored in a hidden field in the form, which
could be viewed by me when the users update the form and send it to
me.

I am able to put the combo fields using the forms menu.

I am not able to calculate the average of the inputed fields and hide
the same.

Any advice, appreciated.

Thanking you.

PR.

Re: Word Form by Doug

Doug
Fri Nov 07 03:27:50 CST 2003

Hi PR,

Assuming that you have n Dropdown fields with the bookmark names Dropdown1,
Dropdown2, ... Dropdownn-1, Dropdownn, then if you run the following macro
on exit from each of the Dropdown fields

Dim i as integer, vsum as long

vsum = 0
For i = 1 to n
vsum = vsum + ActiveDocument.Formfields("Dropdown" & i).Result
Next i
ActiveDocument.Variables("vAverage").Value = vsum/n

Then when you get the document back, run a macro containing the following
code and the average will be displayed in a message box.

MsgBox ActiveDocument.Variables("vAverage").Value

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
"PR" <getpras@yahoo.com> wrote in message
news:c2e96c1d.0311060809.1a72e8be@posting.google.com...
> Hi
>
> Request some help in automating a form in word. I need to create form
> which would be sent as an email to users. This form would accept
> numerical data in combo boxes from the users. Then average result
> needs to be calculated and stored in a hidden field in the form, which
> could be viewed by me when the users update the form and send it to
> me.
>
> I am able to put the combo fields using the forms menu.
>
> I am not able to calculate the average of the inputed fields and hide
> the same.
>
> Any advice, appreciated.
>
> Thanking you.
>
> PR.