WDK: Invoice3 Template Causes WordBasic Error 134

Last reviewed: July 31, 1997
Article ID: Q145323
The information in this article applies to:
  • Microsoft Word for Windows NT, version 6.0
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, version 7.0

SYMPTOMS

When you create a new document with the Invoice3.dot template from the Word Developers Kit (third edition), the following error message appears:

     WordBasic ERR=134
     An argument to a function contained an illegal date or time.

CAUSE

This problem occurs if you use a system date of December.

WORKAROUND

To work around this problem, use the following steps:

WARNING: ANY USE BY YOU OF THE OR MACRO CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  1. On the File menu, click Open.

  2. Locate Invoice3.dot and click OK.

  3. On the Tools menu, click Macro.

  4. Select the AutoNew macro, and then click Edit.

  5. On the Edit menu, click Find.

  6. In the Find What box, type "month" (without the quotation marks). Click Find Next.

    Word scrolls to the code that results in the error message.

  7. Click the Cancel button.

  8. Modify the macro code as follows:

    The current code:

    If Month(Today()) <> 12 Then SetFormResult "ShipDate",

            Date$(DateSerial(Year(Today()), Month(Today()) + 1, Day(Today())))
         Else
            SetFormResult "ShipDate", Date$(DateSerial(Year(Today()) + 1,
            Month(Today()) + 1, Day(Today())))
         End If
    
       Change the code to read as follows:
    
         If Month(Today()) <> 12 Then SetFormResult "ShipDate",
            Date$(DateSerial(Year(Today()), Month(Today()) + 1, Day(Today())))
         Else
            SetFormResult "ShipDate", Date$(DateSerial(Year(Today()) + 1,
            1, Day(Today())))
         End If
    
    

  9. On the File menu, click Save.

    This saves changes to the macro.

  10. On the File menu, click Close.

    This closes the macro window.

  11. On the File menu, click Save.

    This saves the changes to the Invoice3.dot template.

  12. On the File menu, click Close.

    This closes the Invoice3 template.

STATUS

Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

REFERENCES

"Microsoft Word Developers Kit," third edition, Appendix B, pages 969-1001


KBCategory:
KBSubcategory:

Additional query words:
Version : 6.0 7.0
Platform : WINDOWS


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: July 31, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.