Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Text form field loses formatting in Word 2010
I am trying to create a very simple form in Word 2010 (RTM, on Win7) which
has three fields: Qty, Unit Price, Ext. Price. Am using the legacy Text Form field for each. The details on how I set up properties is below. I restrict editing and then save it (as a DOTX, DOCX or even DOC-tried all), and then open it to type values in my fields. Here's the problem: the fields do not format the data as instructed. For example, I type in a unit price of $1.50 and it saves the value of "1". That's it, just the number 1, and does not format it as instructed (as currency). It displays the qty correctly, but it strips out the currency formatting for Ext. Price as well. All calculations are working (based on the values it saves in the form field, not the values I've typed in), but the formatting is in error, and that makes the calculation results wrong. When I go back and view properties for each field, the number format is blank - as if I never selected/changed it. If I select again, restrict, save, and try again, still no formatting. What might be causing this? I've tried in an old document and a brand new one and the same thing happens. Information from this point forward is supplemental about how I set properties for each field. After I insert each field, I open the Properties and make appropriate changes: Qty field: Number type, unlimited length, number format #,##0, calculate on exit checked. Unit Price field: Number type, unlimited length, number format $#,##0.00;($#,##0.00), calculate on exit checked. Ext price field: Calculation, unlimited length, number format $#,##0.00;($#,##0.00), calculate on exit NOT checked. Editing restrictions are set to allow only Filling in forms. Thanks for any insights you might have. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Text form field loses formatting in Word 2010
That is an issue that I came across last week. A way around the problem is
to run the following macro on exit from any formfield to which you want to apply the formatting: Sub formatfldresult() Dim ffname As String ffname = Selection.Bookmarks(Selection.Bookmarks.Count).Nam e With ActiveDocument.FormFields(ffname) .Result = Format(.Result, "$#,###.00") End With End Sub -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Michelle H." Michelle wrote in message ... I am trying to create a very simple form in Word 2010 (RTM, on Win7) which has three fields: Qty, Unit Price, Ext. Price. Am using the legacy Text Form field for each. The details on how I set up properties is below. I restrict editing and then save it (as a DOTX, DOCX or even DOC-tried all), and then open it to type values in my fields. Here's the problem: the fields do not format the data as instructed. For example, I type in a unit price of $1.50 and it saves the value of "1". That's it, just the number 1, and does not format it as instructed (as currency). It displays the qty correctly, but it strips out the currency formatting for Ext. Price as well. All calculations are working (based on the values it saves in the form field, not the values I've typed in), but the formatting is in error, and that makes the calculation results wrong. When I go back and view properties for each field, the number format is blank - as if I never selected/changed it. If I select again, restrict, save, and try again, still no formatting. What might be causing this? I've tried in an old document and a brand new one and the same thing happens. Information from this point forward is supplemental about how I set properties for each field. After I insert each field, I open the Properties and make appropriate changes: Qty field: Number type, unlimited length, number format #,##0, calculate on exit checked. Unit Price field: Number type, unlimited length, number format $#,##0.00;($#,##0.00), calculate on exit checked. Ext price field: Calculation, unlimited length, number format $#,##0.00;($#,##0.00), calculate on exit NOT checked. Editing restrictions are set to allow only Filling in forms. Thanks for any insights you might have. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Text form field loses formatting in Word 2010
Doug Robbins - Word MVP wrote on 06/06/2010 03:22 ET :
That is an issue that I came across last week. A way around the problem is to run the following macro on exit from any formfield to which you want to apply the formatting: Sub formatfldresult() Dim ffname As String ffname = Selection.Bookmarks(Selection.Bookmarks.Count).Nam e With ActiveDocument.FormFields(ffname) .Result = Format(.Result, "$#,###.00" End With End Sub Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Michelle H." <Michelle wrote in message news: I am trying to create a very simple form in Word 2010 (RTM, on Win7) which has three fields: Qty, Unit Price, Ext. Price. Am using the legacy Text Form field for each. The details on how I set up properties is below. I restrict editing and then save it (as a DOTX, DOCX or even DOC-tried all), and then open it to type values in my fields. Here's the problem: the fields do not format the data as instructed. For example, I type in a unit price of $1.50 and it saves the value of "1". That's it, just the number 1, and does not format it as instructed (as currency). It displays the qty correctly, but it strips out the currency formatting for Ext. Price as well. All calculations are working (based on the values it saves in the form field, not the values I've typed in), but the formatting is in error, and that makes the calculation results wrong. When I go back and view properties for each field, the number format is blank - as if I never selected/changed it. If I select again, restrict, save, and try again, still no formatting. What might be causing this? I've tried in an old document and a brand new one and the same thing happens. Information from this point forward is supplemental about how I set properties for each field. After I insert each field, I open the Properties and make appropriate changes: Qty field: Number type, unlimited length, number format #,##0, calculate on exit checked. Unit Price field: Number type, unlimited length, number format $#,##0.00;($#,##0.00), calculate on exit checked. Ext price field: Calculation, unlimited length, number format $#,##0.00;($#,##0.00), calculate on exit NOT checked. Editing restrictions are set to allow only Filling in forms. Thanks for any insights you might have. I tried this macro solution but it only partially worked for me. The field is formatted correctly but the cents portion of the number is being truncated and shown as ".00". |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Text form field loses formatting in Word 2010
That is an issue that I came across last week. A way around the problem is to run the following macro on exit from any formfield to which you want to apply the formatting: Sub formatfldresult() Dim ffname As String ffname = Selection.Bookmarks(Selection.Bookmarks.Count).Nam e With ActiveDocument.FormFields(ffname) .Result = Format(.Result, "$#,###.00") End With End Sub -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Michelle H." Michelle wrote in message ... I am trying to create a very simple form in Word 2010 (RTM, on Win7) which has three fields: Qty, Unit Price, Ext. Price. Am using the legacy Text Form field for each. The details on how I set up properties is below. I restrict editing and then save it (as a DOTX, DOCX or even DOC-tried all), and then open it to type values in my fields. Here's the problem: the fields do not format the data as instructed. For example, I type in a unit price of $1.50 and it saves the value of "1". That's it, just the number 1, and does not format it as instructed (as currency). It displays the qty correctly, but it strips out the currency formatting for Ext. Price as well. All calculations are working (based on the values it saves in the form field, not the values I've typed in), but the formatting is in error, and that makes the calculation results wrong. When I go back and view properties for each field, the number format is blank - as if I never selected/changed it. If I select again, restrict, save, and try again, still no formatting. What might be causing this? I've tried in an old document and a brand new one and the same thing happens. Information from this point forward is supplemental about how I set properties for each field. After I insert each field, I open the Properties and make appropriate changes: Qty field: Number type, unlimited length, number format #,##0, calculate on exit checked. Unit Price field: Number type, unlimited length, number format $#,##0.00;($#,##0.00), calculate on exit checked. Ext price field: Calculation, unlimited length, number format $#,##0.00;($#,##0.00), calculate on exit NOT checked. Editing restrictions are set to allow only Filling in forms. Thanks for any insights you might have. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word text copied into email loses formatting alignment | Microsoft Word Help | |||
Formatting a Text Form Field | Tables | |||
Text Form Field Formatting | Microsoft Word Help | |||
Formatting text form field - can I make the text wrap? | Microsoft Word Help | |||
Word form fixed length text field that doesn't change formatting? | Microsoft Word Help |