How can I create a header in a table for each new page with Word interop?

落爺英雄遲暮 提交于 2019-12-19 09:23:31

问题


I am trying to create a table with a header. I want this header to be repeated for each new page that the table takes. How can I do this in C# with Word 2007 Interop?


回答1:


Microsoft.Office.Interop.Word.Table table;
/* ... */
table.Rows[1].HeadingFormat = -1;



回答2:


This is what word for me, Looping through each table at the end

            foreach (Table item in doc.Tables)
            {
                item.Rows[1].HeadingFormat = -1;
                item.ApplyStyleHeadingRows = true;
            }

and setting a style on each table with the property set to create a header on each new

                    t.set_Style(TableStyle);


来源:https://stackoverflow.com/questions/1816957/how-can-i-create-a-header-in-a-table-for-each-new-page-with-word-interop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!