novacode-docx

Novacode DocX Different page orientations within the same document

我与影子孤独终老i 提交于 2019-12-05 10:42:11
Using the following code, I'm trying to create a document in which pages 2 and 3 are landscape while the others are portrait. All should be 8.5" x 11". using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { using (DocX document = DocX.Create(ms)) { document.PageLayout.Orientation = Novacode.Orientation.Portrait; document.PageWidth = 816F; document.PageHeight = 1056F; document.MarginTop = 50F; document.MarginRight = 50F; document.MarginBottom = 75F; document.MarginLeft = 50F; document.AddHeaders(); document.AddFooters(); document.DifferentFirstPage = true; document

DocX clone table and insert at index

白昼怎懂夜的黑 提交于 2019-12-03 20:12:26
问题 I am using C# to make a simple Windows app using Novacode to manipulate a Word document. I have a source table in my Word document that I want to clone. I am able to find the source table okay using this code: Table sourceTable = document.Tables[3]; I can see by the rows and columns that this is in fact the table that I want to clone. I have a string in my Word doc that right after it I want to insert my cloned source table. In fact, I may need to insert it more than once. I don't know how to

DocX clone table and insert at index

ⅰ亾dé卋堺 提交于 2019-11-30 15:16:32
I am using C# to make a simple Windows app using Novacode to manipulate a Word document. I have a source table in my Word document that I want to clone. I am able to find the source table okay using this code: Table sourceTable = document.Tables[3]; I can see by the rows and columns that this is in fact the table that I want to clone. I have a string in my Word doc that right after it I want to insert my cloned source table. In fact, I may need to insert it more than once. I don't know how to find my string, the index of it, and then insert the one or more cloned tables at that index. Thanks.