Increase performance when formatting column widths

G

GazzaJ

I have a big Word document where I create many tables and then format the
width of each column within each table e.g.

Create table
myTable.Columns[1].Width = wordApp.CentimetersToPoints(2.81F);
myTable.Columns[2].Width = wordApp.CentimetersToPoints(3.09F);
etc for 11 columns

This appears to the bottleneck in performance. Is there a better way to set
the column widths of a table, maybe in one go.
 
J

Jay Freedman

If every table has exactly the same set of columns with the same widths,
then set it up once as an empty table and save it as an AutoText entry in
the template for the document. Then for each new table you can just insert
the AutoText entry and put data in the cells.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
C

challa prabhu

Do the following:
1. Open a new Word document.
2. On the Format menu, click Style and Formatting.
The Styles and Formatting panel opens on the right of the document window.
You will notice that there is not Table style sheet available.
3. Do one of the following:
On the Table menu, point to Insert, and then click Table. The Insert Table
dialog appears click ok
-or-
Click the Isert Table icon onthe Table and Border toolbar. Click OK in the
Insert Table dialog box.
Note: the Table Grid style sheet is displayed under the Pick formatting to
apply, in the Styles and Formatting panel
4. Click the Table Grid Arrow next to the style sheet name.
5. Click Modify Style. The Modify Style dialog box displays.
6. Click the Format list and select Table properties.
7. In the Table Properties dialiog box, click the Table tab. Then click the
Options button. The Table Options dialog box displays. Specify the Default
Margins and the Default cell spacing. Then click OK to return to the Table
options dialog box.
8. In the Table Properties dialiog box, click the Row tab and clear the All
row to break across pages.
9. Click OK in the Table options dialog box.
10. Click OK in theModify Style dialog box.
11. Click the Table Grid Arrow nect to the style sheet name.
12. click Set as default table style.
The Default Table Style dialog box displays.
13. Click All documents based on the Normal.dot template? option under the
Do you want to set this style as the default table style for:
14. Click OK.

Challa Prabhu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top