Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

iNSERT A RELATIVE HYPERLINK using vba

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
arne - 04 Feb 2005 12:53 GMT
Can I insert a relative hyperlink in documents using vba? One that will
hyperlink to the main.htm in the same folder ?
(I have a lot of  folders, and each of them contain one main.htm, while I
manually save the word converted htmfiles in the correct folder)
I am using word 2000

Sub tomain_arne()
' this is an absolute ref
' I want   "E:\docweb\main.htm" to be inserted as a relative reference like
' <a href="main.htm">To main htm in samefolder 1</a>
   ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
       "E:\docweb\main.htm", SubAddress:="", ScreenTip:="To main htm in
samefolder", TextToDisplay:= _
       "To Main"
End Sub

arne
Jezebel - 04 Feb 2005 22:04 GMT
>    ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
>        "main.htm", SubAddress:="", ScreenTip:="To main htm in
> samefolder", TextToDisplay:= _
>        "To Main"

> Can I insert a relative hyperlink in documents using vba? One that will
> hyperlink to the main.htm in the same folder ?
[quoted text clipped - 14 lines]
>
> arne
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.