2016-11-14 2 views
0

문서의 모든 단락을 반복하고 들여 쓰기 수준을 확인하려고합니다. 이 작업은 Paragraph.Format.LeftIndent를 사용하여 대부분 작동하지만 테이블 내의 단락에는 작동하지 않습니다. 특히 단락 자체가 들여 쓰기되지는 않지만 테이블에 왼쪽 들여 쓰기가있는 경우에 그렇습니다.현재 단락을 기반으로 테이블 개체에 액세스하십시오.

currelty 선택한 단락에서 해당 단락으로 이동하는 방법이 있습니까? "wdWithInTable"속성이 있다는 것을 알지만 LeftIndent 속성을 확인하기 위해 Table 개체가 필요하기 때문에이 정도면 충분하지 않습니다.

답변

0

이동 현재의 선택 사용으로이 논리 테이블을 얻을 :

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 Sub