Microsoft KB Archive/123100

{|
 * width="100%"|

WD: ToolsCreateLabels Uses AutoText Entry Instead of LabelText

 * }

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, 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 : kbmacro wordnt kbautotext ntword macword word6 word7 word95

Issue type : kbprb

Technology :