VBA for updating specific fields

Hello,

Let me first say that I understand noting of VBA, so please forgive any misconceptions on my part. I created a quotation-styled form with a few fields containing formulas (i.e. total price, taxes...) in Word. Their value depends on columns like product price, quantity, etc.

I would like to add an ActiveX button to update these specific fields once I have filled in the form (so the document would be protected). I have set bookmark names to them, since I assume the code would need to call them.

Also, I would like the button not to show when printing.

Can this be achieved? What would be the code?

Thank you.
Answer
Answer

The 'calculate on exit' property should be set on the input fields, not on the calculating fields. Additionally, using formfields to do the calculations is buggy; better to use formula fields for that.

 

To see how to do a wide range of calculations in Word using formula fields, check out my Microsoft Word Field Maths Tutorial, at:

or

http://www.gmayor.com/downloads.htm#Third_party

Cheers
Paul Edstein
(Fmr MS MVP - Word)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 242 Applies to: