Microsoft KB Archive/117705

= WD: How to Add a PREPAID or DEPOSIT Row to the Invoice Template =

Article ID: 117705

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Word 6.0 Standard Edition
 * Microsoft Word 6.0a
 * Microsoft Word 6.0c
 * Microsoft Word 6.0 Standard Edition
 * Microsoft Word 95 Standard Edition
 * Microsoft Word 95a
 * Microsoft Word 97 Standard Edition
 * Microsoft Word 6.0 for Macintosh
 * Microsoft Word 6.01 for Macintosh
 * Microsoft Word 6.01 for Macintosh
 * Microsoft Word 98 for Macintosh

-



This article was previously published under Q117705



SUMMARY
This article describes how to add a PREPAID or DEPOSIT row to the Invoice template.



MORE INFORMATION
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 a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

https://partner.microsoft.com/global/30000104

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

Use the following steps to add a PREPAID or DEPOSIT row to the bottom of the Invoice.

Word 97 for Windows or Word 98 Macintosh Edition
 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. Open the Invoice template (Invoice.dot) file. On the Tools menu, click Unprotect Document. Position the insertion point at the beginning of the SALES TAX cell. On the Table menu, click Insert Rows.

A new row should appear between the SUBTOTAL and SALES TAX rows.  In the first cell of the new row, type PREPAID or DEPOSIT.

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) </li> Position the insertion point in the second cell of the new row (cell D10 in the above diagram).</li> On the View menu, point to Toolbars, and then click Forms.</li> Click the Text Form Field button on the Forms toolbar.</li> Double-click the form field.</li> In the Text Form Field Options dialog box, select the following settings and then click OK: <ol style="list-style-type: lower-alpha;"> In the Type box, select Number.</li> Under Run Macro On, select Update_.Main from the Exit list.</li> Under Field Settings, type Deposit or Prepaid in the Bookmark box.</li> In the Number Format list, select the fifth format:

$#,##0.00;($#,##0.00)

</li> Leave all the other settings at their default values.</li></ol> </li> 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.</li> 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)

</li> Use the following instructions to modify the Update macro: <ol style="list-style-type: lower-alpha;"> On the Tools menu, point to Macro, and then click Macros.</li> In the Macro Name list, click Update_.Main, and then click the Edit button.</li>  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. </li> <li>On the File menu in the Visual Basic Editor, click "Close and Return to Microsoft Word."</li></ol> </li> <li>On the Tools menu, click Protect Document. Select the Forms option, and then click OK.</li> <li>Save and close the Invoice template.</li></ol>

Word 6.x, 7.x
<ol> <li>Open the Invoice template (Invoice.dot) file.</li> <li>On the Tools menu, click Unprotect Document.</li> <li>Position the insertion point at the beginning of the SALES TAX cell.</li> <li>On the Table menu, click Insert Rows.

A new row should appear between the SUBTOTAL and SALES TAX rows.</li> <li> In the first cell of the new row, type PREPAID or DEPOSIT.

Your modified table should now appear as follows: <pre class="fixed_text">                 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) </li> <li>Position the insertion point in the second cell of the new row (cell D10 in the above diagram).</li> <li>On the Insert menu, click Form Field.</li> <li>Select the Text option, and then click the Option button.</li> <li>In the Text Form Field Options dialog box, select the following settings and then choose OK: <ol style="list-style-type: lower-alpha;"> <li>In the Type box, select Number.</li> <li>Under Run Macro On, select Update from the Exit list.</li> <li>Under Field Settings, type Deposit or Prepaid in the Bookmark box.</li> <li>Leave all the other settings at their default values.</li></ol> </li> <li>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.</li> <li>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)

</li> <li>Use the following instructions to modify the Update macro: <ol style="list-style-type: lower-alpha;"> <li>On the Tools menu, click Macro. In the Macro Name list, click Update, and then click the Edit button.</li> <li> 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. </li></ol> </li> <li>Close the macro editing window and choose Yes when Word prompts you to save changes.</li> <li>On the Tools menu, click Protect Document. Select the Forms option and then click OK.</li> <li>Save and close the Invoice template.</li></ol>

<div class="references_section">

Word 97 and Word 98 Macintosh Edition
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:

120802 Office: How to Add/Remove a Single Office Program or Component

Word 6.x, 7.x
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: kbtable kbtemplate KB117705

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.