WD: ToolsCreateLabels Uses AutoText Entry Instead of LabelText

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

SYMPTOMS

If you use the LabelAutoText argument with the ToolsCreateLabels WordBasic statement, Microsoft Word ignores the LabelText argument and inserts the text of the specified AutoText entry instead.

For example, the following statement inserts the ToolsCreateLabels1 AutoText entry specified by the LabelAutoText argument instead of the "123" string specified by the LabelText argument:

ToolsCreateLabels .ExtractAddress = 0, .LabelListIndex = 0, .LabelIndex = 48, .LabelDotMatrix = 0, .LabelTray = 1, .PrintBarCode = 0, .SingleLabel = 0, .LabelRow = "1", .LabelColumn = "1", .AddToDocument, .LabelAutoText = "ToolsCreateLabels1", .LabelText = "123"

CAUSE

When you include the LabelAutoText argument as part of a ToolsCreateLabels statement, Word always uses that argument, even if the statement also contains a LabelText value.

WORKAROUND

To work around this problem, use either of the following methods.

Method 1: Use the LabelText Argument Only, Not the LabelAutoText Argument

If you want to specify the label text as part of the ToolsCreateLabels statement, use the .LabelText argument only and not the .LabelAutoText argument. For example, if you remove the LabelAutoText argument from the above macro, Word inserts the "123" LabelText argument as expected:

   ToolsCreateLabels .ExtractAddress = 0, .LabelListIndex = 0, \
   .LabelIndex = 48, .LabelDotMatrix = 0, .LabelTray = 1, \
   .PrintBarCode = 0, .SingleLabel = 0, .LabelRow = "1", \
   .LabelColumn = "1", .AddToDocument, .LabelText = "123"

Method 2: Delete the AutoText Entry

If you want to leave the LabelAutoText argument in your macro, you can delete the AutoText entry (in the above macro, the AutoText entry is named ToolsCreateLabels1). When the macro cannot find the AutoText entry named in the LabelAutoText argument, it uses the LabelText value instead.

STATUS

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


Additional query words: macros Tools EnvelopesAndLabels
Keywords : kbautotext macword ntword word6 word7 word95 wordnt kbmacro
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a; MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH WINDOWS
Issue type : kbprb
Solution Type : kbworkaround


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.