Microsoft KB Archive/183642

= WD98: Sample Macro Code to Select Table Columns and Rows =

Article ID: 183642

Article Last Modified on 6/17/2005

-

APPLIES TO


 * Microsoft Word 98 for Macintosh

-



This article was previously published under Q183642





SUMMARY
In Word, you can use the Visual Basic for Applications macro language to select columns or rows in tables.



MORE INFORMATION
Microsoft 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. The following Visual Basic for Applications examples demonstrate selecting columns or rows in a Microsoft Word for Windows table.

Selecting Columns
This example selects the second column in the first table of a document. ActiveDocument.Tables(1).Columns(2).Select

Selecting Rows
This example selects the second row in the first table of a document. ActiveDocument.Tables(1).Rows(2).Select For more information about Tables collection object, from the Visual Basic Editor, click the Office Assistant, type Tables Collection, click Search, and then click to view "Tables Collection Object."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If the Assistant is not able to answer your query, please see the following article in the Microsoft Knowledge Base:

176476 OFF: Office Assistant Not Answering Visual Basic Questions

For additional information, please see the following article in the Microsoft Knowledge Base:

181058 OFF98: How to Run Sample Code from Knowledge Base Articles

