Microsoft KB Archive/281864

= Selection object macros only work on last selection in Word =

Article ID: 281864

Article Last Modified on 1/29/2007

-

APPLIES TO


 * Microsoft Office Word 2003
 * Microsoft Word 2002 Standard Edition

-



This article was previously published under Q281864



SYMPTOMS
When you run a Microsoft Visual Basic for Applications macro that uses selection objects and inserts text in a document that contains a non-contiguous selection, only the last selection is affected by the macro.



CAUSE
This behavior occurs when you have multiple selections and run a macro that contains selection objects. Microsoft Office Word allows only one selection object to be active at a time. Thus, when you use multiple selections, the macro only affects the last selection.



WORKAROUND
To work around this behavior, do not use multiple selections when you run a macro that contains selection objects. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

288424 Limited programmatic access to Word 2002 discontiguous selections

