Ben Reese
2007-04-03 16:18:04 UTC
Hello
I need to programatically add hyperlinks to a word document, But I cant work
out the proper syntax.
I am using A VB.Net 2005 Program with a reference to
Microsoft.Office.Interop.Word
I am able to locate the range for which I want to add the hyperlink but I
don't know what parameters I should pass into Document.Hyperlinks.Add,
Particularly the Anchor parameter, passing the range From My cell doesnt work:
MyDocument.Hyperlinks.Add(MyCell.Range, "MyURL")
I have created a VBA macro in Word and the syntax is this, But I cant
translate it into anytjing .net will understand:
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:="URL", _
SubAddress:="", ScreenTip:="", TextToDisplay:="Link"
This article doesnt make sense at all..
http://msdn2.microsoft.com/en-us/library/microsoft.office.interop.word.hyperlinks.add(VS.80).aspx
Thanks. Confused :~
Ben
I need to programatically add hyperlinks to a word document, But I cant work
out the proper syntax.
I am using A VB.Net 2005 Program with a reference to
Microsoft.Office.Interop.Word
I am able to locate the range for which I want to add the hyperlink but I
don't know what parameters I should pass into Document.Hyperlinks.Add,
Particularly the Anchor parameter, passing the range From My cell doesnt work:
MyDocument.Hyperlinks.Add(MyCell.Range, "MyURL")
I have created a VBA macro in Word and the syntax is this, But I cant
translate it into anytjing .net will understand:
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:="URL", _
SubAddress:="", ScreenTip:="", TextToDisplay:="Link"
This article doesnt make sense at all..
http://msdn2.microsoft.com/en-us/library/microsoft.office.interop.word.hyperlinks.add(VS.80).aspx
Thanks. Confused :~
Ben