我正在迭代文档中的所有段落,并希望确定它们的缩进级别。虽然这在大多数情况下都适用于使用Paragraph.Format.LeftIndent,但它不适用于表中的段落。尤其是在段落本身未缩进但表格具有左缩进的情况下。
有没有办法从currelty选定的段落导航到它所在的表格?我知道有属性"wdWithInTable“,但这对我来说还不够,因为我需要表对象来检查它的LeftIndent属性。
发布于 2016-11-15 23:51:09
使用以下逻辑从当前选择中获取表:
Sub GetTable()
Dim currentTable As Table
Set currentTable = Selection.Tables(1)
'test purpose only
Debug.Print currentTable.Rows.Count, currentTable.Columns.Count
'and to get table indention try with this
Debug.Print currentTable.Range.ParagraphFormat.LeftIndent
End Subhttps://stackoverflow.com/questions/40584222
复制相似问题