【发布时间】:2018-04-18 01:27:45
【问题描述】:
Outlook VBA 中是否有与 Excel 的 FollowHyperlink 等效的方法?
我制作了一个 Excel VBA 宏,它使用 FollowHyperlink 方法将剪贴板中的文本发布到特定站点。
我想用 Outlook VBA 做同样的事情,但我找不到方法。
任何与FollowHyperlink 做同样事情的方法都很好。
这是一个 Excel VBA 版本的函数,它将剪贴板的内容发布到谷歌翻译。我想制作这个的 Outlook 版本。
Public Sub GoogleTranslate_2EN()
Dim clipBoard As New DataObject
With clipBoard
On Error Resume Next
.GetFromClipboard
Dim targetText As String
targetText = .GetText
On Error GoTo 0
End With
Dim URL As String
URL = "https://translate.google.co.jp/?hl=en&tab=wT#auto/en/" & targetText
ThisWorkbook.FollowHyperlink Address:=URL, newWindow:=False, AddHistory:=True
End Sub
【问题讨论】:
-
发布您当前的代码,我们也许可以将其修改为 Outlook vba
-
我尝试使用 shell 作为文章“使用 VBA 在默认浏览器中打开 html 页面?”中的代码。使用 shell 不会像 FollowHyperlink 那样进行 HTML 编码。