locked
Open xml row height RRS feed

  • Question

  • how to increase the row height or cell padding of word table which has data already? I don't want to create new table, just update the row height of already existing table. help me out please.
    Wednesday, December 16, 2015 8:56 AM

Answers

  • The best way to find out something like this is to make the change to the document then save it under a different name. Use the Open XML SDK Productivity Tool to compare the original document and the changed one and look at the code to create the change. 

    To do this, find the change (difference) in the Open XML, click on it, then click "View Code".

    (Note that it makes things simpler if you create a small document that has only the thing (in your case, table) you're interested in.)

    In my quick test, it shows me:

                TableRowProperties tableRowProperties1 = new TableRowProperties();
                TableRowHeight tableRowHeight1 = new TableRowHeight(){ Val = (UInt32Value)558U };
    
                tableRowProperties1.Append(tableRowHeight1);
                tableRow1.InsertBefore(tableRowProperties1,tableCell1);
    


    Cindy Meister, Office Developer/Word MVP, <a href="http://blogs.msmvps.com/wordmeister"> my blog</a>

    Wednesday, December 16, 2015 4:19 PM

All replies

  • Hello,

    This question is best asked in the forum I am moving your question too.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter or Facebook via my MSDN profile but will not answer coding question on either.

    Wednesday, December 16, 2015 1:26 PM
  • The best way to find out something like this is to make the change to the document then save it under a different name. Use the Open XML SDK Productivity Tool to compare the original document and the changed one and look at the code to create the change. 

    To do this, find the change (difference) in the Open XML, click on it, then click "View Code".

    (Note that it makes things simpler if you create a small document that has only the thing (in your case, table) you're interested in.)

    In my quick test, it shows me:

                TableRowProperties tableRowProperties1 = new TableRowProperties();
                TableRowHeight tableRowHeight1 = new TableRowHeight(){ Val = (UInt32Value)558U };
    
                tableRowProperties1.Append(tableRowHeight1);
                tableRow1.InsertBefore(tableRowProperties1,tableCell1);
    


    Cindy Meister, Office Developer/Word MVP, <a href="http://blogs.msmvps.com/wordmeister"> my blog</a>

    Wednesday, December 16, 2015 4:19 PM