penfold1992
06-10-2014, 02:18 AM
Hello All,
I want to create a macro that essentially puts a web address on whatever text you highlight.
Sub Test()
Dim ObjItem As MailItem
Set ObjItem = Application.ActiveInspector.CurrentItem ' to target the current mail item
Dim Sel As Word.Selection
Set Sel = Application.ActiveInspector.WordEditor.Windows(1).Selection ' to target the selection
Dim URL As String
URL = 'url link that I cant post due to post restrictions'
Sel.Hyperlinks.Add Sel, URL
Set Oli = Nothing
Set Sel = Nothing
This doesnt work but it should be some useful pseudo code as to what I am trying to achieve.
Thanks in advance!
I want to create a macro that essentially puts a web address on whatever text you highlight.
Sub Test()
Dim ObjItem As MailItem
Set ObjItem = Application.ActiveInspector.CurrentItem ' to target the current mail item
Dim Sel As Word.Selection
Set Sel = Application.ActiveInspector.WordEditor.Windows(1).Selection ' to target the selection
Dim URL As String
URL = 'url link that I cant post due to post restrictions'
Sel.Hyperlinks.Add Sel, URL
Set Oli = Nothing
Set Sel = Nothing
This doesnt work but it should be some useful pseudo code as to what I am trying to achieve.
Thanks in advance!