• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2464
  • Last Modified:

setting ms word table column width via C#

hello experts,

how do I set the column width of a table in MS Word 2002.

at this point, i am just guessing around.  here is my best guess:

Word.Table table = doc.Tables.Add(r, 1, 8, ref objTableBehavior,      ref objAutoFit);  <--adding table to documnet
Word.Column myCol1 = table.Columns.Item(1);  
myCol1.Width = 5F;

when attempting to run, i get "value out of range" error message.

thanks
0
brdrok
Asked:
brdrok
  • 2
  • 2
1 Solution
 
Farshid-ZakerCommented:
Hi,
In fact there is lower limit for a word table column's width. You should use values greater than 10.

<Farshid/>
0
 
brdrokAuthor Commented:
Hey Farshid....

i increased the range from 5 to 25 and i have not gotten the errormessage, however, it doesn't seem to have increased the column width at all...

0
 
brdrokAuthor Commented:
nevermind...i am being too stringy with my width properties....

thanks for your help
0
 
Farshid-ZakerCommented:
you'r welcome :)

<Farshid/>
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now