Advertisement
Guest User

Untitled

a guest
Aug 4th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. public void InsertTable(string bookmark, IList<Dictionary<string, object>> rowValues)
  2. {
  3.     if (!IsDocumentOpen) return;
  4.  
  5.     var bookmarkNavigator = new BookmarksNavigator(mDocument);
  6.  
  7.     try {
  8.         bookmarkNavigator.MoveToBookmark(bookmark);
  9.     }
  10.     catch(Exception ex) {
  11.         return;
  12.     }
  13.            
  14.     var part = bookmarkNavigator.GetBookmarkContent();
  15.     if(part.BodyItems.FirstItem is IWTable table)
  16.         foreach(WTableRow row in table.Rows)
  17.             foreach (WTableCell cell in row.Cells)
  18.                 foreach (WParagraph paragraph in cell.Paragraphs)
  19.                     paragraph.Text = "TEST";        
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement