Word Form

P

PR

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.
 
D

Doug Robbins - Word MVP

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
 

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