2010-06-16 18 views
2

複製與內容控制的表格有沒有辦法與預定義的樣式,字體,內容控制等從一個頁面複製表到另一個頁面,這樣我可以在不同的不同的數據填寫故事。 所以比如我wwould有,可以說,一個表,其中顯示一個人的姓名,年齡,地址在一個表中。那麼下一頁具有相同的表格樣式,但是信息是不同的。Word 2007中:從一個網頁到另一個

這可能嗎?我找到了克隆行/列但不是整個表的方法。

我在OpenXML SDK 2.0中使用C#。任何在這個問題上的幫助將不勝感激。

感謝您的期待。

問候

回答

0

article可以幫助

foreach (var order in customerOrderHistory) 
    { 
     TableRow rowCopy = (TableRow)theRow.CloneNode(true); 
     rowCopy.Descendants<TableCell>().ElementAt(0).Append(new Paragraph 
      (new Run (new Text(order.Contact.ToString())))); 
     rowCopy.Descendants<TableCell>().ElementAt(1).Append(new Paragraph 
      (new Run (new Text(order.NameOfProduct.ToString())))); 
     rowCopy.Descendants<TableCell>().ElementAt(2).Append(new Paragraph 
      (new Run (new Text(order.Amount.ToString())))); 
     theTable.AppendChild(rowCopy); 
    } 
相關問題