Powerpoint VBA-未创建形状超链接
我可以在任何其他模块中调用以下代码:Powerpoint VBA-未创建形状超链接,vba,powerpoint,Vba,Powerpoint,我可以在任何其他模块中调用以下代码: Public Sub LinkToAddInfo(currentSlide As Long, boxName As String, addNumber As Long) Dim oShape As Shape Set oShape = ActivePresentation.Slides(currentSlide).Shapes.AddShape(msoShapeRoundedRectangle, 640, 470, 71, 27)
Public Sub LinkToAddInfo(currentSlide As Long, boxName 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
With .ActionSettings(ppMouseClick)
.Action = ppActionHyperlink
.Hyperlink.SubAddress = ActivePresentation.Slides(addNumber).Name
End With
End With ' Shape itself
End Sub
这是为了创建一个链接到另一张幻灯片的形状。除了带有.ActionSettings(ppMouseClick)部分的之外,代码的每一部分都工作得非常好
为什么没有创建超链接?只需替换.Hyperlink.SubAddress=ActivePresentation.Slides(addNumber).Name
使用.Hyperlink.SubAddress=addNumber
这是假设addNumber
是您要超链接到的幻灯片 您能否尝试用实际数字替换addNumber
变量,看看它是否有效?.Hyperlink.SubAddress=ActivePresentation.Slides(此处)。Name
no,不幸的是,这没有什么区别。在with.ActionSettings(ppMouseClick)
代码块中,添加一个Debug.Print
行,查看该代码块中的任何内容是否实际存在running@PuravTheGreat完成并测试。是的,是的。