Nipendra.dhiman
Member
Hi all,
i have little query here,
I am working on the 200 pages document in word 2010, and i need a hyperlink on a every page to go back to the home page(Fisrt page), let say i am on the page number 32 and want to go back the first page it is difficult to go back. I have one way that I can make the hyperlink manually on every page but the document is very larg.
i was trying with some code but not very familiar with vba in word.
Option Explicit
Sub AddHyperlinkToBookmark()
Dim doc As documents
For Each doc In ActiveDocument
Dim oBookmark As Bookmark
Dim oHyperlink As Hyperlink
'***** Add code to select text for bookmark
Set oBookmark = ThisDocument.Bookmarks.Add("BookmarkName", Selection.Range)
'***** Add code to select text for link
Set oHyperlink = ThisDocument.Hyperlinks.Add(Selection.Range, "", "Document Hyper")
Set oBookmark = Nothing
Set oHyperlink = Nothing
Next
End Sub
Please suggest if possible.
Regards
Nipendra
i have little query here,
I am working on the 200 pages document in word 2010, and i need a hyperlink on a every page to go back to the home page(Fisrt page), let say i am on the page number 32 and want to go back the first page it is difficult to go back. I have one way that I can make the hyperlink manually on every page but the document is very larg.
i was trying with some code but not very familiar with vba in word.
Option Explicit
Sub AddHyperlinkToBookmark()
Dim doc As documents
For Each doc In ActiveDocument
Dim oBookmark As Bookmark
Dim oHyperlink As Hyperlink
'***** Add code to select text for bookmark
Set oBookmark = ThisDocument.Bookmarks.Add("BookmarkName", Selection.Range)
'***** Add code to select text for link
Set oHyperlink = ThisDocument.Hyperlinks.Add(Selection.Range, "", "Document Hyper")
Set oBookmark = Nothing
Set oHyperlink = Nothing
Next
End Sub
Please suggest if possible.
Regards
Nipendra