如何使用 Office interop 迭代 Word 文档中的段落项目(例如段落的图像、文本框等)?
最佳答案
这就是迭代文档段落的方法
foreach (Word.Paragraph paragraph in myDocument.Paragraphs)
{
string pText = paragraph.Range.Text;
System.Diagnostics.Debug.WriteLine(pText);
Word.InlineShapes shapes = paragraph.Range.InlineShapes;
System.Diagnostics.Debug.WriteLine("Shape Count: " + shapes.Count);
}
关于c# - 如何使用 Office interop 迭代 Word 文档中的段落项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32227384/