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 支援與意見反應。
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應