J
jbc
Hi,
I'm trying to add up 3 numbers that are stored in form fields. I'm testing
it on a very simple document with the following code. It is working fine
except when I leave a form field blank. I formatted the form fields for
numbers. What am I missing?
Sub AddMeUp()
Dim intOne As Integer
Dim intTwo As Integer
Dim intThree As Integer
Dim Total As Integer
intOne = ActiveDocument.FormFields("text1").Result
intTwo = ActiveDocument.FormFields("text2").Result
intThree = ActiveDocument.FormFields("text3").Result
Total = intOne + intTwo + intThree
MsgBox Total
End Sub
Thanks.
jbc
I'm trying to add up 3 numbers that are stored in form fields. I'm testing
it on a very simple document with the following code. It is working fine
except when I leave a form field blank. I formatted the form fields for
numbers. What am I missing?
Sub AddMeUp()
Dim intOne As Integer
Dim intTwo As Integer
Dim intThree As Integer
Dim Total As Integer
intOne = ActiveDocument.FormFields("text1").Result
intTwo = ActiveDocument.FormFields("text2").Result
intThree = ActiveDocument.FormFields("text3").Result
Total = intOne + intTwo + intThree
MsgBox Total
End Sub
Thanks.
jbc