共用方式為


ShapeRange.Tags 屬性 (Publisher)

會傳回 Tags 集合,此集合代表套用至圖形、圖形範圍、頁面或出版物的標籤或自訂屬性。

語法

運算式標籤

表達 代表 ShapeRange 物件的 變數。

範例

在這個範例中,會將標籤新增至使用中出版物第一頁上的每一個橢圓形圖案。

Dim shp As Shape 
Dim tagsAll As Tags 
Dim tagLoop As Tag 
Dim blnTag As Boolean 
 
With ActiveDocument.Pages(1) 
 For Each shp In .Shapes 
 If shp.AutoShapeType = msoShapeOval Then 
 Set tagsAll = shp.Tags 
 blnTag = False 
 
 For Each tagLoop In tagsAll 
 If tagLoop.Name = "Shape" Then 
 blnTag = True 
 Exit For 
 End If 
 Next tagLoop 
 
 If blnTag = False Then 
 tagsAll.Add Name:="Shape", Value:="Oval" 
 End If 
 End If 
 Next shp 
End With 

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應