|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Create Word Tables
Some code examples in this topic use the this or Me keyword or the
Thecollection is a member of the , and objects, which means that you can create a table in any of those contexts. You use the method of the Tables collection to add a table at the specified range.
To add a simple table to a document
Use the Add method to add a table consisting of three rows and four columns at the beginning of the document.
When you create a table, it is automatically added to the Tables collection of the. You can then refer to the table by its item number using the property, as shown in the following code.
To refer to a table by item number
Use the Item property and supply the item number of the table that you want to refer to:
Eachobject also has a property that enables you to set direct formatting attributes.