none
How to set Rows.HeadingFormat RRS feed

  • Question

  • How can one set the property in question for a table? Is a custom style needed and if so how can I create one and set it to a table?


    Wednesday, August 26, 2015 1:13 PM

Answers

  • I was actually looking for Row.HeadingFormat property in order to not break my table in 2 pages. Sorry for the misunderstood. I've managed to do what I wanted by setting the property on the first row after my table creation

    Table table = wordDoc.Tables.Add(paragraph.Range, 2, 1, ref missing, ref missing);
    table.Rows[1].HeadingFormat = -1;

    Wednesday, August 26, 2015 7:13 PM

All replies

  • Hello Padelis,

    VSTO doesn't provide anything for that. What Office application are you talking about?

    Wednesday, August 26, 2015 1:29 PM
  • Hi Padelis

    I understand the property that you're asking about for Word tables, but I don't understand how you want/need to use it.

    The property can be part of any Table style, but can also be applied directly (not as part of a style). The property needs to be applied to the ROWS object. Here's a sample code snippet that illustrates the object model:

       Document.Tables(1).Rows.AllowBreakAcrossPages = False


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, August 26, 2015 2:33 PM
    Moderator
  • Office Interop, dunno if this is the right forum tbh
    Wednesday, August 26, 2015 6:48 PM
  • I was actually looking for Row.HeadingFormat property in order to not break my table in 2 pages. Sorry for the misunderstood. I've managed to do what I wanted by setting the property on the first row after my table creation

    Table table = wordDoc.Tables.Add(paragraph.Range, 2, 1, ref missing, ref missing);
    table.Rows[1].HeadingFormat = -1;

    Wednesday, August 26, 2015 7:13 PM