How to check if a Paragraph is in a Table or not in MS-Word macro?

后端 未结 3 960
忘了有多久
忘了有多久 2021-01-02 18:02

The paragraph object in the Word has a property called Range. Within this Range object has a property called Cells.

For paragraph that are not in a table, this prop

3条回答
  •  [愿得一人]
    2021-01-02 18:35

    You can use the Information property:

    If Selection.Information(wdWithInTable) Then
      'What ever you'd like to do
    End If
    

    Hence you don't need any manual error catching mechanisms.

提交回复
热议问题