WD2000: wdParagraph with ColumnSelectMode Does Not Select Text Column (212583)
The information in this article applies to:
This article was previously published under Q212583 SYMPTOMS
In a Visual Basic for Applications macro, you cannot use the wdParagraph constant in conjunction with the ColumnSelectMode property to select a vertical column of text.
WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To work around this problem, use the wdLine constant instead of the wdParagraph constant, as in the following example:
Sub SelectVerticalColumn()
With Selection
.Collapse
.ColumnSelectMode = True
' Count specifies the number of characters to the right
' to select. In this case the number is 3.
.MoveRight Unit:=wdCharacter, Count:=3, Extend:=wdExtend
' Count specifies the number of Lines down
' to select. In this case the number is 2.
.MoveDown Unit:=wdLine, Count:=2
End With
End Sub
REFERENCESFor additional information about getting help with Visual Basic for Applications, click the article number below
to view the article in the Microsoft Knowledge Base:
212623 WD2000: Macro Programming Resources
226118 OFF2000: Programming Resources for Visual Basic for Applications
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbbug kbdtacode kbpending kbProgramming KB212583 |
---|
|