Microsoft KB Archive/212727

From BetaArchive Wiki
Knowledge Base


WD2000: Character Format Functions Ignore Leading and Trailing Spaces

Article ID: 212727

Article Last Modified on 10/11/2006



APPLIES TO

  • Microsoft Word 2000 Standard Edition



This article was previously published under Q212727


SYMPTOMS

In Microsoft Word, the following character formatting functions ignore leading and trailing spaces when they evaluate a string:

x = Selection.Font.Hidden
x = Selection.Font.Bold
x = Selection.Font.Italic
x = Selection.Font.Underline
                

For example, if the text in a selection is formatted as hidden, but the spaces at the beginning or end of the selection are not formatted as hidden, the Hidden function returns -1 (True). This indicates that the entire selection is hidden, even though there are unhidden spaces at the beginning or end of the selection.

CAUSE

This functionality is consistent with the design of other features in Word, such as the Format Font dialog box and Formatting toolbar. All these Word features disregard trailing and leading spaces when they evaluate a selection.

Other non-printing characters that are ignored as part of the selection include:

  • 1/4 em space
  • Non-breaking space
  • Line feed
  • Tab


REFERENCES

For additional information about getting help with Visual Basic for Applications, click the article numbers below to view the articles in the Microsoft Knowledge Base:

212623 WD2000: Macro Programming Resources


226118 OFF2000: Programming Resources for Visual Basic for Applications



Additional query words: font hidden bold italic italics underline underscore underlining italicize bolding hiding hide selection beginning ending vb vbe vba

Keywords: kbbug kbdtacode kbnofix KB212727