none
Add multiple header rows in Word Table using C# RRS feed

  • Question

  • Hello,

             I'm trying to make 1st and 2nd rows as header rows in a Word Table.

    I'm only able to make only 1 row as the header row.

    table.Rows[1].HeadingFormat = -1;

    table.Rows[2].HeadingFormat = -1; won't work.

    Thanks,

    Dilip

    • Moved by Amanda Zhu Thursday, October 9, 2014 9:16 AM
    Thursday, October 9, 2014 2:36 AM

Answers

  • Hi Dilip,

    The code works well for me. Which version of Word are you using? Does it work when you set this option manullay? We can set it like steps beow:
    1. select the top second rows

    2. right click and click the Table Proerties

    3. set the option like figure below:

    Was this option checked after you execute the code? If not, I suggest that you update or repair the Word application to see whether this issue was fixed.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, October 10, 2014 2:15 AM
    Moderator

All replies

  • Hi Dilip,

    Because your program is related to Word, I moved this thread to Word for Developers forum for better support.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 9, 2014 9:16 AM
  • Hello Dilip,

    > won't work.

    Could you please be more specific? Do you get any exceptions in the code?

    Did you try to use the following code instead?

    table.Rows.HeadingFormat = -1;

    Does it work as expected?

    Thursday, October 9, 2014 9:51 AM
  • Hi Eugene,

                    Thanks for the reply. Actually my table consists of 7 rows. Each row cell consists of considerable amount of data and it will continue from the next page. The requirement is, I need to have first two rows repeated in each page.

    table.Rows[1].HeadingFormat = -1 would only make the first row as heading row.

    Thanks,

    Dilip

    Thursday, October 9, 2014 10:09 AM
  • Hi Dilip,

    The code works well for me. Which version of Word are you using? Does it work when you set this option manullay? We can set it like steps beow:
    1. select the top second rows

    2. right click and click the Table Proerties

    3. set the option like figure below:

    Was this option checked after you execute the code? If not, I suggest that you update or repair the Word application to see whether this issue was fixed.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, October 10, 2014 2:15 AM
    Moderator