Word Form / Fields or VBA / calculate on print

M

mokshadavid

I have a Word 2003 form in which USERS enter "earned income" amounts in
fields and when they click outside the field, the total calculates using a
formula in a different table cell. The formula will show the sum total amount
of all "earned income" entered in the above table cells/input fields when the
field "calculates on exit" properly.

My problem is that Users are entering their final "earned income" amount,
and then (WITHOUT clicking outside the cell/field), the USER hits PRINT,
which does not let the field "calculate on exit", so that "earned income"
amount doesn't show up in my formula total.

How can I get all fields to calculate before a USER hits PRINT? Is there a
VBA code to use to force this? I don't want to have to tell users they have
to click outside the cell always, because I would rather the form do it
automatically somehow. Any help is appreciated.

It defeats the purpose of a formula in my form unless I can guarantee that
all the "earned income" amount are showing up in the total.
 
D

Doug Robbins - Word MVP

You could include macros with the names of FilePrint() and
FilePrintDefault() in your template that contained code the update the
fields in the document before displaying the File Print Dialog or printing
the document respextively.
--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 
M

mokshadavid

Thanks, those specific commands worked. The only thing is, when I use the
Sub FilePrint() to capture when they go File>>Print, then it doesn't bring up
the print dialog box anymore it just prints.

Here is my code (it works), if I could do it better, let me know...thanx for
your help:

Sub FilePrintDefault()
Application.ScreenUpdating = False
ActiveDocument.Fields.Update
ActiveDocument.PrintOut
End Sub

Sub FilePrint()
Application.ScreenUpdating = False
ActiveDocument.Fields.Update
ActiveDocument.PrintOut
End Sub
 
D

Doug Robbins - Word MVP

Replace

ActiveDocument.PrintOut

with

Dialogs(wdDialogFilePrint).Show

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 

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