WD: Selecting Table Columns and Rows Using WordBasic MacrosLast reviewed: February 2, 1998Article ID: Q93036 |
The information in this article applies to:
SUMMARYThe WordBasic macro language provides the following commands for selecting columns or rows in Word for Windows tables.
MORE INFORMATION
Word 2.x, 6.x, 7.x
TableSelectColumn Selects the column containing the insertion point in a table. The CharRight and CharLeft commands with the Select parameter specified (such as CharRight 1,1) can be used to extend the selection. TableSelectRow Selects the row containing the insertion point in a table. The LineDown command and LineUp commands with the Select parameter specified (such as LineDown 1,1) can be used to extend the selection.NOTE: Before executing a WordBasic table command, you may need to determine if the insertion point is within a table. To do this, use SelInfo(12), which returns -1 if the insertion point is within a table. For example, the following TableSelectRow command will be executed only if the insertion point is within a table:
If SelInfo(12) Then TableSelectRow Word 1.xThe WordBasic macro language in Word 1.x includes the StartofRow, EndOfRow, StartOfColumn, and EndOfColumn commands for selecting rows and columns in Word for Windows tables. To select an entire table row in Word 1.x, use the following commands:
Sub MAIN ' Selects Table Row StartOfRow EndOfRow 1 End SubTo select an entire table column in Word 1.x, use the following commands:
Sub MAIN ' Selects Table Column StartOfColumn EndOfColumn 1 End SubWARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
REFERENCES"Microsoft Word for Windows Technical Reference," page 165-166 "Using WordBasic," by WexTech Systems and Microsoft, pages 300-301
|
Additional query words: TableSelectRow TableSelectColumn
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |