[英]Powerpoint VBA - How to store information 'within' shape?
假設我在 sub 中有以下代碼:
With square
.Fill.ForeColor.RGB = RGB(255, 255, 255)
.Fill.Transparency = 1
.Name = "Foo"
End With
我現在可以根據其.Name
定義搜索,甚至可以在代碼中使用該名稱(例如,我可以將一些字符串值設置為形狀的名稱)。
我的問題是 - 我是否有另一種方法可以將值存儲在“形狀內”? 具體來說,多個字符串和整數。
如果不是,當我基於 Sub 中的一些 String 和 Integer 變量設置形狀的文本時,有沒有辦法允許不同的 Sub 使用這些信息?
你可以使用 square.tags 集合 - square.tags.Add "NAME",VALUE 有一個例子
With square
.Fill.ForeColor.RGB = RGB(255, 255, 255)
.Fill.Transparency = 1
.Name = "Foo"
.Tags.Add "Tag 1", 1
.Tags.Add "Tag 2", 2
' Reading
For a = 1 To .Tags.Count
Debug.Print .Tags.Name(a), .Tags.Value(a)
Next a
End With
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.