Word 2004 Table of Contents

K

Kiran Madabhushi

Hi,
When I generate table of contents in word 2004, the clickable links are on
Page Numbers rather than the text. In Word 2003 on Windows, the entire text
is clickable. How can I make Word 2004 behave like Windows version of Word?
Clicking on the page numbers is not very convenient

Kiran
 
P

Paul Berkowitz

When I generate table of contents in word 2004, the clickable links are on
Page Numbers rather than the text. In Word 2003 on Windows, the entire text
is clickable. How can I make Word 2004 behave like Windows version of Word?
Clicking on the page numbers is not very convenient

You can't. That's how it works in MacWord. It's certainly a shame since I
agree it's much nicer to have the whole TOC entry a link as in WinWord since
Word 2000, I think it is. The problem is that TOC entries in Mac Word still
do not have \h switches (hyperlink switches) available. I cannot understand
why not. I do hope they are added to the next version.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
K

Kristina Conceicao

On 5/17/05 8:53 AM, in article BEAF6193.FBF%[email protected], "Kiran
Paul Berkowitz wrote:>
You can't. That's how it works in MacWord. It's certainly a shame since I
agree it's much nicer to have the whole TOC entry a link as in WinWord since
Word 2000, I think it is. The problem is that TOC entries in Mac Word still
do not have \h switches (hyperlink switches) available. I cannot understand
why not. I do hope they are added to the next version.

My users have a need for this functionality, too. In the meantime, I'm
trying to write a macro that will do it for them. My approach is to put
all of the TOC bookmarks in an array, and then select each entry
(paragraph) in the TOC and hyperlink it to a bookmark in the array.

My only problem is the inability to select *only* the first paragraph of
the TOC. No matter what I do, it selects the entire TOC. I thought I
had it licked - after the entire TOC was selected, I used the command
Selection.Paragraphs(1).Range.Select. However, that was in Word 2004,
and my end users run Word 98 via Classic, and it doesn't work there.

Does anyone know how to select only the first paragraph in a TOC? Or
how to hyperlink a paragraph without selecting it? I know that you
shouldn't need to select things in order to do something to them (at
least, in Excel VBA that's true), but I'm not that well-versed in the
Word object model. My original thought was to loop through all the
paragraphs in the TOC, but I didn't have much luck with that, either.

Thanks,

Kristina
 
D

Daiya Mitchell

I'm pretty sure you could do this manually, by selecting a portion of the
text in the TOC field (though you have to be careful, as usually the entire
field will shade grey and then selecting is a separate action).

I don't know about doing it as a macro. The TOC is one field. I'm not sure
it has paragraphs, according to the object model, and if it did, I would
imagine you would somehow have to specify a paragraph within the field.

I'm not sure why you need the TOC bookmarks in an array? If the TOC is
built from heading styles, they will automatically be listed in the
hyperlink to doc location dialog.

Me, I would probably go the approach of trying to format the page numbers so
that they look like links and visually remind the users they have to click
there.
 
M

mmmmark

I am forced to do most of my "heavy lifting" on Word 2003 for the PC at work
(and use 2004 at home).

On 2003, I have to click on the page number in TOCs, but once PDFmaker makes
my PDFs (the end result) the entire line is 'clickable'. Go figure. Does
this happen in 2004 Word docs that have been turned into PDFs?

-Mark
 
K

Kristina Conceicao

Daiya said:
I don't know about doing it as a macro. The TOC is one field. I'm not sure
it has paragraphs, according to the object model, and if it did, I would
imagine you would somehow have to specify a paragraph within the field.
I agree - as per the object model, it doesn't appear to have paragraphs.
But you can select each "paragraph" individually via a macro (except
for the first one). With the cursor at the beginning of the entry,
"Selection.EndKey Unit:=wdLine, Extend:=wdExtend" will select the entire
paragraph (well, "line", technically; we tend to have one-line entries).
Unfortunately, if your cursor is at the beginning of the first entry,
this command selects the entire TOC.

I'm not sure why you need the TOC bookmarks in an array? If the TOC is
built from heading styles, they will automatically be listed in the
hyperlink to doc location dialog.

An array was just the way I decided to store them for future use by the
macro. I loop through the document, pulling in any bookmarks that begin
with "_toc". That way, they're in the order that I need to apply them
to the TOC entries. That part is working well, but I'm certainly open
to suggestions for a better way. I don't think I'm quite following your
comment about the dialog. Is there some way to figure out the bookmark
that the hyperlinked page number is referring to, so that it could then
be applied to the entire entry?
Me, I would probably go the approach of trying to format the page numbers so
that they look like links and visually remind the users they have to click
there.

That sure would be easier, but all of our clients use PCs, so they're
used to their internal documents having the entire entry hyperlinked,
and ask us to do the same.

Thanks,

Kristina
 
K

Kristina Conceicao

mmmmark said:
I am forced to do most of my "heavy lifting" on Word 2003 for the PC at work
(and use 2004 at home).

On 2003, I have to click on the page number in TOCs, but once PDFmaker makes
my PDFs (the end result) the entire line is 'clickable'. Go figure. Does
this happen in 2004 Word docs that have been turned into PDFs?

-Mark

Using Acrobat to create PDFs from MacWord just isn't the same as in
WinWord. It doesn't have all the functionality. It doesn't carry the
hyperlinks forward at all. If our client wants a PDF, we have to use a
third party utility to hyperlink the TOC, or covert it on a PC. If
that's the case, we can regenerate the TOC on the PC, to fully hyperlink
the entire entry. But we love our macs :) and try to do as much work
as possible on them. We have a few PCs scattered around for when we're
forced to use them.

Thanks,

Kristina
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Kristina:

There's two approaches:

1) Pump all of the Heading paragraphs in the document into the array, then
build your own TOC

2) Or unlink the TOC first, which turns it into normal text from which you
can return individual paragraphs easily.

ActiveDocument.TablesOfContents(1).Range.Fields(1).Unlink

Cheers


My users have a need for this functionality, too. In the meantime, I'm
trying to write a macro that will do it for them. My approach is to put
all of the TOC bookmarks in an array, and then select each entry
(paragraph) in the TOC and hyperlink it to a bookmark in the array.

My only problem is the inability to select *only* the first paragraph of
the TOC. No matter what I do, it selects the entire TOC. I thought I
had it licked - after the entire TOC was selected, I used the command
Selection.Paragraphs(1).Range.Select. However, that was in Word 2004,
and my end users run Word 98 via Classic, and it doesn't work there.

Does anyone know how to select only the first paragraph in a TOC? Or
how to hyperlink a paragraph without selecting it? I know that you
shouldn't need to select things in order to do something to them (at
least, in Excel VBA that's true), but I'm not that well-versed in the
Word object model. My original thought was to loop through all the
paragraphs in the TOC, but I didn't have much luck with that, either.

Thanks,

Kristina

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top