我将一些包含 URL 的文本复制到幻灯片中,如下所示:
这里有一些文字https://myaddress.net
更多文本http://asdf.ghjk
但是,URL 只是纯文本,没有超链接。有没有更快的方法将它们设置为超链接,而无需复制 URL,进入超级链接并在那里设置 URL?也许有某种命令可以将演示文稿中的所有 URL 转换为超链接?
答案1
@sigil,这里有一些供初学者使用的示例代码:
Dim oRng As TextRange
' as a test; you'll have to parse the hyperlinks and get a refernce
' to each as a text range; this just gets a known range from
' an existing string:
Set oRng = ActiveWindow.Selection.TextRange.Characters(13, 18)
' Once you've found a range that looks like a hyperlink, this
' will assign an action setting and a hyperlink address to it:
With oRng
.ActionSettings(1).Action = ppActionHyperlink
.ActionSettings(1).Hyperlink.Address = oRng.Text
End With