Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-17-2014, 08:15 PM
mrhuddman mrhuddman is offline Table of Contents Hyperlinks Mac OS X Table of Contents Hyperlinks Office for Mac 2011
Novice
Table of Contents Hyperlinks
 
Join Date: Jul 2014
Posts: 23
mrhuddman is on a distinguished road
Default Table of Contents Hyperlinks

I have created a table of contents in Word 2011 and I do not use page numbers so I create hyperlinks for each toc entry to their respective location in the book.



This takes FOREVER to do and when I update the toc it STRIPS all the hyerlinks out of my toc.

This is a royal pain!!!!

Is there a way to preserve toc hyperlinks and bookmarks when you update the toc?

Thanks!!!
Reply With Quote
  #2  
Old 07-18-2014, 12:07 AM
macropod's Avatar
macropod macropod is online now Table of Contents Hyperlinks Windows 7 32bit Table of Contents Hyperlinks Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,356
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

Why are you manually creating hyperlinks? By default, a Word TOC functions as hyperlinks without all that extra work. If you prefer a hyperlink format, that's just a matter of choosing the appropriate options when creating the TOC.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-18-2014, 07:58 AM
mrhuddman mrhuddman is offline Table of Contents Hyperlinks Mac OS X Table of Contents Hyperlinks Office for Mac 2011
Novice
Table of Contents Hyperlinks
 
Join Date: Jul 2014
Posts: 23
mrhuddman is on a distinguished road
Default

Perhaps I didn't explain myself properly.

Yes, Word can auto generate a toc with hyperlinks.

However, if you remove the page numbers you also remove the hyperlinks. The real issue here - Is there a way to auto generate a toc with hyperlinks and no page numbers?
Reply With Quote
  #4  
Old 07-18-2014, 03:53 PM
macropod's Avatar
macropod macropod is online now Table of Contents Hyperlinks Windows 7 32bit Table of Contents Hyperlinks Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,356
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

That is easily done, by using the \n switch in the TOC field code. For example, if you select the TOC and press Shift-F9, you might see:
{TOC \h \z \u}
Simply add the \n switch, thus:
{TOC \h \z \u \n}
then press F9 to update the field.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 07-18-2014, 04:07 PM
mrhuddman mrhuddman is offline Table of Contents Hyperlinks Mac OS X Table of Contents Hyperlinks Office for Mac 2011
Novice
Table of Contents Hyperlinks
 
Join Date: Jul 2014
Posts: 23
mrhuddman is on a distinguished road
Default

Paul I was pretty excited when I saw your solution, however, I forgot to mention I'm on a Mac and for some reason Microsoft does not treat switching the same on a Mac as it does on a PC.

Darn!

Reply With Quote
  #6  
Old 07-18-2014, 04:55 PM
macropod's Avatar
macropod macropod is online now Table of Contents Hyperlinks Windows 7 32bit Table of Contents Hyperlinks Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,356
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

So what happens on a Mac with the \n switch?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 07-18-2014, 05:08 PM
mrhuddman mrhuddman is offline Table of Contents Hyperlinks Mac OS X Table of Contents Hyperlinks Office for Mac 2011
Novice
Table of Contents Hyperlinks
 
Join Date: Jul 2014
Posts: 23
mrhuddman is on a distinguished road
Default

Absolutely nothing.

It's weird...
Reply With Quote
  #8  
Old 07-18-2014, 05:24 PM
mrhuddman mrhuddman is offline Table of Contents Hyperlinks Mac OS X Table of Contents Hyperlinks Office for Mac 2011
Novice
Table of Contents Hyperlinks
 
Join Date: Jul 2014
Posts: 23
mrhuddman is on a distinguished road
Default

This is a book for Kindle and I was just notified by the Kindle tech team the only way to make my Word toc hyperlinks is to completely finish the book and then go back and use bookmarks and hyperlinks to rebuild the entire toc (individually).

YIKES!

That is exactly what I was trying to avoid. Bad part is if you "update
" the toc Word kills all the bookmarks and hyperlinks in the toc and you have to start all over...

Reply With Quote
  #9  
Old 07-18-2014, 09:15 PM
macropod's Avatar
macropod macropod is online now Table of Contents Hyperlinks Windows 7 32bit Table of Contents Hyperlinks Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,356
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
  #10  
Old 07-19-2014, 09:28 AM
mrhuddman mrhuddman is offline Table of Contents Hyperlinks Mac OS X Table of Contents Hyperlinks Office for Mac 2011
Novice
Table of Contents Hyperlinks
 
Join Date: Jul 2014
Posts: 23
mrhuddman is on a distinguished road
Default

Paul,

Thank you for hanging in there with me - I really appreciate your efforts!

I'm new to Word and I'm unclear as to how to add this macro.
Reply With Quote
  #11  
Old 07-19-2014, 03:15 PM
macropod's Avatar
macropod macropod is online now Table of Contents Hyperlinks Windows 7 32bit Table of Contents Hyperlinks Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,356
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

For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #12  
Old 07-21-2014, 03:51 PM
mrhuddman mrhuddman is offline Table of Contents Hyperlinks Mac OS X Table of Contents Hyperlinks Office for Mac 2011
Novice
Table of Contents Hyperlinks
 
Join Date: Jul 2014
Posts: 23
mrhuddman is on a distinguished road
Default

Paul,

All is well now.

Thank you for hanging in there!!!
Reply With Quote
Reply

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 03:53 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