View Single Post
 
Old 09-18-2014, 09:25 AM
odin odin is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Sep 2014
Posts: 11
odin is on a distinguished road
Default

Ok...I've got pretty much everythings setup but I can't seem to get the hyperlink portion of the code to work. I've tried it a few ways but I keep getting an error.

Compil error:
Expected: end of statement

Tried this:
Code:
 
.Cell(webIndex + 1, 3).Range.End -1 = ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:=oObjForm.webaddTextBox.Text, _
        SubAddress:="", ScreenTip:="", TextToDisplay:=oObjForm.dspTextBox.Text
Also Tried this:
Code:
 
webText = ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:=oObjForm.webaddTextBox.Text, _
        SubAddress:="", ScreenTip:="", TextToDisplay:=oObjForm.dspTextBox.Text
 
.Cell(webIndex + 1, 3).Range.End -1 = webText
If I have the following by itself to run as alone it'll make the hyperlink and no errors:
Code:
 
Sub insertLink()
Dim dspTxt As String
Dim webTxt As String
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
        "http://www.microsoft.com", SubAddress:="", ScreenTip:="", TextToDisplay:="Testing Link"
I am at a loss as of now. Any ideas?
Reply With Quote