ID: Q117705
The information in this article applies to:
This article describes how to add a PREPAID or DEPOSIT row to the Invoice template.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/
Use the following steps to add a PREPAID or DEPOSIT row to the bottom of
the Invoice.
1. Copy the Invoice.dot file to your templates folder. The Invoice.dot
file shoudl be located in the "ValuPack\Template\Word" folder
(Windows) or the "ValuPack\Template\Word\Additional Word
Templates" folder (Macintosh) on the Office or Word compact disc.
2. Open the Invoice template (Invoice.dot) file.
3. On the Tools menu, click Unprotect Document.
4. Position the insertion point at the beginning of the SALES TAX cell.
5. On the Table menu, click Insert Rows.
A new row should appear between the SUBTOTAL and SALES TAX rows.
6. In the first cell of the new row, type "PREPAID" or "DEPOSIT" (without
the quotation marks).
Your modified table should now appear as follows:
SUBTOTAL| **** | <- cell D9 (contains a FORM field)
DEPOSIT| | <- cell D10 (blank)
SALES TAX| **** | <- cell D11 (contains a FORM field)
SHIPPING & HANDLING| **** | <- cell D12 (contains a FORM field)
TOTAL DUE| **** | <- cell D13 (contains a FORM field)
7. Position the insertion point in the second cell of the new row (cell
D10 in the above diagram).
8. On the View menu, point to Toolbars, and then click Forms.
9. Click the Text Form Field button on the Forms toolbar.
10. Double-click the form field.
11. In the Text Form Field Options dialog box, select the following
settings and then click OK:
a. In the Type box, select Number.
b. Under Run Macro On, select Update_.Main from the Exit list.
c. Under Field Settings, type "Deposit" or "Prepaid" (without the
quotation marks) in the Bookmark box.
d. In the Number Format list, select the fifth format:
$#,##0.00;($#,##0.00)
e. Leave all the other settings at their default values.
12. Double-click the FORM field to the right of the TOTAL DUE cell (cell
D13 in the diagram in step 5). The Text Form Field Options dialog
box should be displayed.
13. In the Text Form Field Options dialog box, modify the entry in the
Expression box so that it reads as follows, and then click OK:
=SUM(D9,D11,D12)-SUM(D10)
14. Use the following instructions to modify the Update macro:
a. On the Tools menu, point to Macro, and then click Macros.
b. In the Macro Name list, click Update_.Main, and then click
the Edit button.
c. In the macro editing window, change this portion of the macro
If fieldName$ = "Shipping" Or fieldName$ = "SalesTax" Then
Goto TOTAL
EndIf
to the following:
If fieldName$ = "Shipping" Or fieldName$ = "SalesTax" _
Or fieldName$ = "Deposit" Then
Goto TOTAL
EndIf
NOTE: In this macro, "Deposit" is the bookmark name you set in
step 11. If you set a different bookmark name in step 11,
use that name instead of "Deposit" in the Update macro.
d. On the File menu in the Visual Basic Editor, click "Close and Return
to Microsoft Word."
15. On the Tools menu, click Protect Document. Select the Forms option,
and then click OK.
16. Save and close the Invoice template.
1. Open the Invoice template (Invoice.dot) file.
2. On the Tools menu, click Unprotect Document.
3. Position the insertion point at the beginning of the SALES TAX cell.
4. On the Table menu, click Insert Rows.
A new row should appear between the SUBTOTAL and SALES TAX rows.
5. In the first cell of the new row, type "PREPAID" or "DEPOSIT" (without
the quotation marks).
Your modified table should now appear as follows:
SUBTOTAL| **** | <- cell D9 (contains a FORM field)
DEPOSIT| | <- cell D10 (blank)
SALES TAX| **** | <- cell D11 (contains a FORM field)
SHIPPING & HANDLING| **** | <- cell D12 (contains a FORM field)
TOTAL DUE| **** | <- cell D13 (contains a FORM field)
6. Position the insertion point in the second cell of the new row (cell
D10 in the above diagram).
7. On the Insert menu, click Form Field.
8. Select the Text option, and then click the Option button.
9. In the Text Form Field Options dialog box, select the following
settings and then choose OK:
a. In the Type box, select Number.
b. Under Run Macro On, select Update from the Exit list.
c. Under Field Settings, type "Deposit" or "Prepaid" (without the
quotation marks) in the Bookmark box.
d. Leave all the other settings at their default values.
10. Double-click the FORM field to the right of the TOTAL DUE cell (cell
D13 in the diagram in step 5 above). The Text Form Field Options dialog
box should open.
11. In the Text Form Field Options dialog box, modify the entry in the
Expression box so it reads as follows, and then choose OK:
=SUM(D9,D11,D12)-SUM(D10)
12. Use the following instructions to modify the Update macro:
a. On the Tools menu, click Macro. In the Macro Name list, click
Update, and then click the Edit button.
b. In the macro editing window, change this portion of the macro
If fieldName$ = "Shipping" Or fieldName$ = "SalesTax" Then
Goto TOTAL
EndIf
to the following:
If fieldName$ = "Shipping" Or fieldName$ = "SalesTax" _
Or fieldName$ = "Deposit" Then
Goto TOTAL
EndIf
NOTE: In the this macro, "Deposit" is the bookmark name you set in
step 9. If you set a different bookmark name in step 9, use
that name instead of "Deposit" in the Update macro.
13. Close the macro editing window and choose Yes when Word prompts you to
save changes.
14. On the Tools menu, click Protect Document. Select the Forms
option and then click OK.
15. Save and close the Invoice template.
For more information about online forms, click the Office Assistant, type "Online Forms," click Search, and then click to view "Designing a form."
NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Word Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q120802
TITLE : Office: How to Add/Remove a Single Office
Program or Component
For more information about the Invoice template, double-click the Help button on the Standard toolbar, and then type "readme" (without the quotation marks). In Word Readme Help, select the Word for Windows Product Update topic, and then select the Supplied Online Business Forms topic.
Additional query words: financial
Keywords : kbtemplate kbtable
Version : 6.0 6.0.1 6.0.1a 98 | 6.0 6.0a 6.0c 7.0 7.0a 97
Platform : MACINTOSH WINDOWS
Last Reviewed: April 8, 1999