2014-01-13 38 views

回答

1

您必须抓取FlowDocument的每个节点,然后最终将其内容转换为相应的段落,如DocX库的InsertAfter方法。

我试过使用DocX,但将它从WPF转换为Word并不容易。我们结束了使用RTFWord使其正常布局,而不必处理与它实际上看起来像WPF和Word

样品

Table currentTable = CreateDocXTable(table.Columns.Count, table.RowGroups[0].Rows.Count); 
if(block is Section) 
{ 
var editableSection = block as Section; 
var content = new TextRange(editableSection.ContentStart, editableSection.ContentEnd); 
currentTable.Rows[rowIndex].Cells[cellIndex].Paragraphs[0].InsertText(content.Text); 
} 
布局