2016-03-15 74 views
0

表內要確定形狀是Table,你可以使用下面的代碼中:確定是否形狀是使用基於索引的參考

ActiveDocument.InlineShapes.Item(1).Select 

If Selection.Information(wdWithInTable) Then 
     MsgBox "In Table" 
Else 
     MsgBox "Not In Table" 
End If 

我想刪除所有Select/Selection等從我的代碼和移動到基於索引的引用,然後我可以使用引用的形狀來執行各種更改。但我似乎無法弄清楚如何確定它是否在表中。

我需要這樣的東西:

Dim CurrentPicture As InlineShape 
Set CurrentPicture = ActiveDocument.InlineShapes.Item(1) 

If CurrentPicture.Information(wdWithInTable) Then 
     MsgBox "In Table" 
Else 
     MsgBox "Not In Table" 
End If 

回答

0

只需使用以下命令:

CurrentPicture.Range.Information(wdWithInTable) 
相關問題