Graham
Tue Jun 26 03:08:34 CDT 2007
Further to Peter's comments, don't use the form fields to perform the
calculations, use a calculated field eg
{ ={ Text1 } + { Text2 } \# "£,0.00;-£,0.00" } For this calculation to work
it must be in the body of the document and the relevant form field calculate
on exit check boxes must be checked.
To format the form fields themselves you can run macros on exit from the
relevant fields (which for this to work should be set as text fields).
At their simplest the macros could be something like
Sub GetContent()
Dim oFld As FormFields
Dim strNum As String
Set oFld = ActiveDocument.FormFields
strNum = oFld("Text1").Result
oFld("Text1").Result = Format(strNum, "£#,##0.00")
End Sub
Sub GetContent2()
Dim oFld As FormFields
Dim strNum As String
Set oFld = ActiveDocument.FormFields
strNum = oFld("Text2").Result
oFld("Text2").Result = Format(strNum, "£#,##0.00")
End Sub
etc
http://www.gmayor.com/installing_macro.htm
Paul J wrote:
> I am creating a (Word 2003) protected form using Text Form Fields to
> accept input (and to perform a calculation on previously input Number
> fields).
>
> The Number Format dropdown box in the Text Form Field Options menu
> where the Type is Number, offers only a limited set of number of
> available formats.
>
> One of these formats, £#,##0.00;(£#,##0.00), can be edited to
> £#,##0;(£#,##0) to allow input of values of whole Pounds (Sterling)
> only. HOWEVER, I am not happy with the format of the negative values
> (i.e. in parentheses) and I would REALLY prefer to use "£,0;-£,0".
>
> I am able to use my prefered number format to display the result in
> the Calculation type of Text Form Field - but I have been unable to
> see how I can apply this format to a(n input) Number type Text Form
> Field.
>
> Can anybody help, please?
>
> PJ