遍历paragraph时快速越过table的算法思考 产生一组Range对象集合 以表格为间隔,产生多个Range对象 使用时,遍历Range对象集合 在Range对象中再遍历操作 基于for(i)遍历Paragraph/ListParagraph跳过 如果是表格 判断表格中的Paragraph/ListParagraph数量 for(i)中的i+表格中paragraph数量

#region [基于for(i)遍历Paragraph/ListParagraph跳过]遍历paragraph时快速越过table的算法思考-成功-2022年4月30日18:32:55
if ((bool)selectionRange.ListParagraphs[i].Range.Information[Word.WdInformation.wdWithInTable])
{
i = i + selectionRange.ListParagraphs[i].Range.Tables[1].Range.ListParagraphs.Count - 1;
continue;
}
#endregion
#region [基于for(i)遍历Paragraph/ListParagraph跳过]遍历paragraph时快速越过table的算法思考-成功-2022年4月30日18:32:55
if ((bool)selectionRange.Paragraphs[i].Range.Information[Word.WdInformation.wdWithInTable])
{
i = i + selectionRange.Paragraphs[i].Range.Tables[1].Range.Paragraphs.Count - 1;
continue;
}
#endregion
计算公式正确性识别: 
|