5

Is it possible to create a quick part that autoreplaces a string with an hyperlink in Outlook 2010? I would like to avoid the vba used in the question Convert Plain Text to Hyperlink in Outlook .

Example

  • if I type (and press F3)

google something

  • It replaces it with the hyperlink

something

Which links to:

https://www.google.nl/?q=something#newwindow=1&q=something
4
  • You may avoid VBA and quick-parts by using AutoHotkey to create a shortcut macro that issues the keys that do the job.
    – harrymc
    Dec 7, 2013 at 16:51
  • Although I like the idea and would go with the solution if it was my private computer, I'm not allowed to install software, without a lot of approvals and lengthy procedures at work.
    – spoorcc
    Dec 7, 2013 at 17:31
  • AHK is portable so doesn't require installation. The file AutoHotkey.exe is all that is needed to launch any .ahk script.
    – harrymc
    Dec 7, 2013 at 17:50
  • I'm still curious if there is a outlook only solution, but thank you for your answers.
    – spoorcc
    Dec 8, 2013 at 8:49

1 Answer 1

1
+50

You may avoid VBA and quick-parts by using AutoHotkey to create a shortcut macro that issues the keys that do the job.

But since you ask for an Outlook solution, here is a simple (and even somewhat tested) VBA macro to convert the currently selected text to a hyperlink of the type you requested:

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
4
  • Will try it, but is there no solution outside using vba's or external software? Something like autoreplace in Word?
    – spoorcc
    Dec 8, 2013 at 21:43
  • As far as I know, Outlook has no such in-built capabilities. As Quick Parts do not accept parameters they are not a solution.
    – harrymc
    Dec 9, 2013 at 6:42
  • I'm not allowed to use vba at work sigh, but since I assume your answer covers the functionality I want, I'll accept your answer.
    – spoorcc
    Dec 13, 2013 at 15:52
  • You could still go in the direction of a AutoHotkey macro.
    – harrymc
    Dec 13, 2013 at 17:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .