我正在使用 C# (3.5) 阅读 word 文档Microsoft.Office.Interop.Word
。逐行读取,将行拆分为array[]并处理行中的每个单词,并根据某些业务逻辑替换某些单词,并在替换单词后将整行替换为转换后的行。
到现在为止一切正常。
现在我有一些word文档,那些有段落和表格。我想一一阅读表格的每一列,并替换特定列中列的内容。
更新
使用办公自动化
1. Opening word file.
2. Moving cursor to top of the document
3. Selecting first line using (`wordApp.Selection.endKey`) and processing all words
4. After processing the words replacing the selected line with the processed line.
5. Using wordApp.Selection.MoveDown(ref lineCount, ref countPage, ref MISSING);
moving next line processed further.
问题:1.读取表格时,使用时只读取第一列wordApp.Selection.endKey
我想处理所有列的数据。有什么方法可以识别内容是段落还是表格?