【发布时间】:2019-12-06 00:35:38
【问题描述】:
我的代码如下(标签构建引用this answer):
Public Sub LinkToAddInfo(currentSlide As Long, boxName As String, addDisplay As Long, addName As String, addNumber As Long)
Dim oShape As Shape
Set oShape = ActivePresentation.Slides(currentSlide).Shapes.AddShape(msoShapeRoundedRectangle, 640, 470, 71, 27)
With oShape
.Fill.ForeColor.RGB = RGB(191, 191, 191)
.Fill.Transparency = 0
.Name = boxName
.Tags.Add("Nametag",ActivePresentation.Slides(addNumber).Name)
With .ActionSettings(ppMouseClick)
.Action = ppActionHyperlink
.Hyperlink.SubAddress = addNumber
End With
End With ' Square itself
End Sub
一切正常,但.Tags.Add("Nametag",ActivePresentation.Slides(addNumber).Name) 行引发语法错误。即使我将后半部分替换为像"test" 这样的硬编码字符串也是如此。
这是为什么?
【问题讨论】:
标签: vba powerpoint