Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 07-18-2014, 09:15 PM
macropod's Avatar
macropod macropod is offline Table of Contents Hyperlinks Windows 7 32bit Table of Contents Hyperlinks Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

OK, so hiding the page #s isn't going to do what you need anyway.

In that case, what you probably need is a macro like the following to convert the TOC to hyperlinks. Do note, though, that hyperlinks don't update the way TOC fields do, so it's probably best to not do the conversion until the document is otherwise finalised.
Code:
Sub ConvertTOC2Hyperlinks()
Dim RngTOC As Range, RngItem As Range, StrBkMkList As String, StrTmp As String, i As Long
With ActiveDocument
  With .TablesOfContents(1)
    .Update
    For i = 2 To .Range.Fields.Count
      StrBkMkList = StrBkMkList & "|" & Split(Trim(.Range.Fields(i).Code.Text), " ")(1)
    Next
    Set RngTOC = .Range
  End With
  RngTOC.Fields.Unlink
  For i = 1 To UBound(Split(StrBkMkList, "|"))
    Set RngItem = RngTOC.Paragraphs(i).Range
    RngItem.End = RngItem.End - 1
    StrTmp = Replace(Split(StrBkMkList, "|")(i), "Toc", "HL")
    .Bookmarks.Add Name:=StrTmp, Range:=.Bookmarks(Split(StrBkMkList, "|")(i)).Range
    .Bookmarks(Split(StrBkMkList, "|")(i)).Delete
    .Hyperlinks.Add Anchor:=RngItem, SubAddress:=.Bookmarks(StrTmp).Range, _
      TextToDisplay:=.Bookmarks(StrTmp).Range.Text
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
table of contents, toc, toc hyperlinks



Similar Threads
Thread Thread Starter Forum Replies Last Post
hyperlinks in a table eNGiNe Word 10 12-05-2012 04:02 PM
Table of Contents Hyperlinks Table of Contents Shakes Word 2 10-24-2012 08:21 AM
Table of Contents Hyperlinks How to keep hyperlinks when creating a table of contents Abacaxi Word 3 04-18-2012 12:24 AM
Table of Contents Hyperlinks VBA and hyperlinks in table cells viuf PowerPoint 13 02-19-2012 10:34 AM
Word with frames, table of contents, and hyperlinks to html NHMC Word 0 12-09-2009 12:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:36 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft