S
Spencer.Sadkin
I am trying to run the following from excel with the word library
reference.
Option Explicit
Sub CopyHyperlink()
Dim app As Word.Application
Dim doc As Document
Dim url As String
Set app = New Word.Application
Set doc = app.Documents.Add
app.Visible = True
doc.Hyperlinks.Add Anchor:=Selection.Range, Address:="http://
www.google.com", SubAddress:="", _ ScreenTip:="", TextToDisplay:="Link
Title"
End Sub
the issues is on doc.Hyperlinks.Add Anchor:=Selection.Range,
Address:="http://www.google.com", _ SubAddress:="", ScreenTip:="",
TextToDisplay:="Link Title"
however that line of works just fine if used as standalone and
changing doc to activedocument in the word vba editor any ideas?
reference.
Option Explicit
Sub CopyHyperlink()
Dim app As Word.Application
Dim doc As Document
Dim url As String
Set app = New Word.Application
Set doc = app.Documents.Add
app.Visible = True
doc.Hyperlinks.Add Anchor:=Selection.Range, Address:="http://
www.google.com", SubAddress:="", _ ScreenTip:="", TextToDisplay:="Link
Title"
End Sub
the issues is on doc.Hyperlinks.Add Anchor:=Selection.Range,
Address:="http://www.google.com", _ SubAddress:="", ScreenTip:="",
TextToDisplay:="Link Title"
however that line of works just fine if used as standalone and
changing doc to activedocument in the word vba editor any ideas?