Solved

setting ms word table column width via C#

Posted on 2004-10-22
2,308 Views
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.

thanks
0
Question by:brdrok
    4 Comments
     
    LVL 4

    Accepted Solution

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

    <Farshid/>
    0
     
    LVL 7

    Author Comment

    by:brdrok
    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
     
    LVL 7

    Author Comment

    by:brdrok
    nevermind...i am being too stringy with my width properties....

    thanks for your help
    0
     
    LVL 4

    Expert Comment

    by:Farshid-Zaker
    you'r welcome :)

    <Farshid/>
    0

    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 (http://www.experts-exchange.com/articles/17490/). 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