Microsoft KB Archive/117705

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 12:26, 21 July 2020 by X010 (talk | contribs) (Text replacement - "&" to "&")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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:

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

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

  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.

    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:
    1. In the Type box, select Number.
    2. Under Run Macro On, select Update_.Main from the Exit list.
    3. Under Field Settings, type Deposit or Prepaid in the Bookmark box.
    4. In the Number Format list, select the fifth format:

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

    5. 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:
    1. On the Tools menu, point to Macro, and then click Macros.
    2. In the Macro Name list, click Update_.Main, and then click the Edit button.
    3. 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.

    4. 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.

Word 6.x, 7.x

  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.

    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:
    1. In the Type box, select Number.
    2. Under Run Macro On, select Update from the Exit list.
    3. Under Field Settings, type Deposit or Prepaid in the Bookmark box.
    4. 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:
    1. On the Tools menu, click Macro. In the Macro Name list, click Update, and then click the Edit button.
    2. 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.


REFERENCES

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