MOD2000: Unexpected Results Running String Editor a Second Time (236505)



The information in this article applies to:

  • Microsoft Office 2000 Developer

This article was previously published under Q236505
Moderate: Requires basic macro, coding, and interoperability skills.

SYMPTOMS

If you run the String Editor a second time on a string that originally contained quotation marks, the String Editor may return unexpected results.

CAUSE

When you type a string that contains quotation marks, the String Editor evaluates the string properly. However, all of the text in the resulting string is highlighted, except for the last character. If you then leave the resulting string highlighted as it is, and run the String Editor a second time, the resulting string is missing the last character, and is therefore invalid. When the Visual Basic Editor tries to parse a string that is invalid, you receive unexpected results.

RESOLUTION

If you want to run the String Editor a second time on an existing string, make sure the entire string is highlighted.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

  1. Open any Office Application and press ALT+F11 to open the Visual Basic Editor.
  2. On the Insert menu, click Module.
  3. On the Add-ins menu, click String Editor.
  4. In the String Editor, type the following string:

    "a" + "b"

  5. Click Update.

    Note that the following string appears in the module:

    Chr$ (34) & "a" & Chr$(34) & " + " & Chr$(34) & "b" & Chr$(34)

    Note that all of the text in the string is highlighted, except for the last parenthesis.
  6. Leave the selected text as it is, and then on the Add-ins menu click String Editor.
Note that the following text appears in the String Editor:

"a" + "bChr$(34


Modification Type:MajorLast Reviewed:7/31/2001
Keywords:kbbug kbStringEditor KB236505