spo*_*rcc 5 microsoft-outlook microsoft-outlook-2010
是否可以创建一个快速部件,在 Outlook 2010 中用超链接自动替换字符串?我想避免在问题Convert Plain Text to Hyperlink in Outlook 中使用的 vba 。
谷歌的东西
链接到:
https://www.google.nl/?q=something#newwindow=1&q=something
Run Code Online (Sandbox Code Playgroud)
您可以使用AutoHotkey创建一个发出执行该工作的按键的快捷方式宏,从而避免使用 VBA 和快速部件。
但由于您需要 Outlook 解决方案,这里有一个简单(甚至经过一些测试)的 VBA 宏,用于将当前选定的文本转换为您请求的类型的超链接:
Sub SelectionToHyperlink()
' Convert the current selection to a hyperlink
If ActiveInspector.EditorType = olEditorText Then
MsgBox "Can't add links to textual mail"
Exit Sub
End If
Dim doc As Object
Dim sel As Object
Set doc = ActiveInspector.WordEditor
Set sel = doc.Application.Selection
doc.Hyperlinks.Add Anchor:=sel.Range, _
Address:="https://www.google.nl/?newwindow=1&q=" & sel.Text, _
SubAddress:="", _
ScreenTip:="", _
TextToDisplay:=sel.Text
End Sub
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1187 次 |
| 最近记录: |