WD: How to Modify the Sales Tax Form Field in Invoice.dot

Last reviewed: February 3, 1998
Article ID: Q118840
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1, 6.0.1a
  • Microsoft Word for NT, version 6.0
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Microsoft Word 97 for Windows
  • Microsoft Word 98 Macintosh Edition

SUMMARY

This article describes how to change the Sales Tax Form Field Options for the Invoice and Purchase Order templates so that your results automatically update with a sales tax amount.

MORE INFORMATION

To modify the Invoice or Purchase Order template so that the Sales Tax field is updated automatically, follow the steps appropriate for your version of Word.

Word 97 and Word 98 Macintosh Edition

Follow these steps:

  1. Copy the Invoice and Purchase Order templates from the ValuPack to the Templates folder.

          Windows Location:
    

          ValuPack\Template\Word folder on the Office 97 or Word 97
    
             CD-ROM into the \Program Files\Microsoft Office\Templates folder.
    
          Macintosh Location:
    
          ValuPack:Templates:Word:Macintosh on the Office 98 or
             Word 98 Macintosh Edition CD-ROM into the Macintosh HD:Microsoft
             Office98:Templates folder.
    
    

  2. Open the Invoice or Purchase Order template and click Unprotect Document on the Tools menu.

  3. On the Tools menu, point to Macro, and then click Macros. In the Macro Name list, click Update_MAIN, and then click Edit.

        The macro will be opened in the Visaul Basic Editor.
    

  4. On the Edit menu, click Find. In the Find What box, type "SetFormResult" (without the quotation marks), and then click Find Next. Click Cancel to exit the Find dialog box.

        SetFormResult will be highlighted.
    

        This section of the macro contains the following two SetFormResult
        commands:
    

          WordBasic.SetFormResult  "Amount_" + rownnum$
          WordBasic.SetFormResult "Subtotal"
    

  5. Add a blank line below the last WordBasic.SetFormResult statement and then type the following command on this blank line:

           WordBasic.SetFormResult "SalesTax"
    

        NOTE: The capitalization of SalesTax is important.
    

  6. On the File menu, click "Close and Return to Microsoft Word."

  7. Double-click the SalesTax form field.

  8. In the Text Form Field Options dialog box, select Calculation from the Type list.

        In the Expression box, enter the formula you want to use to calculate
        the sales tax. Assuming your sales tax is 6 percent and you are
        performing the sales tax on the subtotal field, type the following
        formula in the Expression box for the specific template listed below:
    
         Template         Formula   Comment
         ---------------------------------------------------------------------
    
         Invoice          =D9*.06   where D9 is the table cell reference for
                                    the subtotal amount.
    
         Purchord         =E9*.06   where E9 is the table cell reference for
                                    the subtotal amount.
    
    

  9. Click OK.

  10. On the Tools menu, click Protect Document, select Forms, and then click OK.

  11. Save and close the template.

Word 6.x, 7.x

Follow these steps:

  1. Open the Invoice or Purchase Order template file.

  2. On the Tools menu, click Unprotect Document.

  3. On the Tools menu, click Macro.

  4. In the Macro Name list select the Update macro, and then click Edit.

  5. On the Edit menu, click Find. In the Find What box, type "SetFormResult" (without the quotation marks), and then click Find Next. Click Cancel to exit the Find dialog box. SetFormResult will be highlighted.

  6. This section of the macro contains the following two SetFormResult commands:

          SetFormResult  "Amount_" + rownum$
          SetFormResult "Subtotal"
    

        Add a blank line below the last SetFormResult statement and then type
        the following command on this blank line:
    

           SetFormResult "SalesTax"
    

        NOTE: The capitalization of SalesTax is important.
    

  7. On the File menu, click Close. Choose Yes when prompted to save changes to the template.

  8. If you are using Windows, double-click the SalesTax field. If you are using the Macintosh, point and click over this field while holding the Control key to access the Shortcut menu. Choose Form Field Options.

  9. In the Text Form Field Options dialog box, select Calculation from the Type list. In the Expression box, enter the formula you want to use to calculate the sales tax. Assuming your sales tax is 6 percent and you are performing the sales tax on the subtotal field, type the following formula in the Expression box for the specific template listed below:

          Template         Formula                 Comment
    
          Invoice          =D9*.06   where D9 is the table cell reference for
                                     the sub total amount.
    
          Purchord         =E9*.06   where E9 is the table cell reference for
                                     the sub total amount.
    
    

  10. Click OK.

  11. From the Tools menu, choose Protect Document, select Forms, then click

        OK. Save and close the template.
    

When you create a document based on the template, this field will automatically calculate the percentage of sales tax.


Additional query words: invoice.dot salestax update formfield purchord.dot
Keywords : kbtemplate macword winword word6 word7 word8 word95 word97 word98
Version : WINDOWS:6.0,6.0a,7.0,7.0a,97;MACINTOSH:6.0,6.0.1,6.0.1a,98
Platform : MACINTOSH WINDOWS
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 3, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.