setting ms word table column width via C#

Posted on 2004-10-22
Last Modified: 2008-01-09
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.

Question by:brdrok
    LVL 4

    Accepted Solution

    In fact there is lower limit for a word table column's width. You should use values greater than 10.

    LVL 7

    Author Comment

    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...

    LVL 7

    Author Comment

    nevermind...i am being too stringy with my width properties....

    thanks for your help
    LVL 4

    Expert Comment

    you'r welcome :)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    This video Micro Tutorial is the first in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 ( But the ability to create custom scanning profiles al…

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now