I have a document with three tables of contents: one for a general
table of contents and the other two for figures and tables, resp. I
would like to modify the TOC field for the last two tables in order to
show a message like "No figures in this document" if the TOC has no
entries. The field code for the table of contents is:
{ TOC \h \z \t "Figure caption" \c }
Thanks in advance,
Unai
{ IF { TOC \h \z \t "Figure caption" \c } = "Error! No table of figures
entries found." "No figures in this document" "{ TOC \h \z \t "Figure
caption" \c }" }
Unfortunately, I tried this, and it does not work. Perhaps someone else can
come up with a better solution.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
"pum" <unai.sa...@gmail.com> wrote in message
news:3099ac8f-ff79-4827...@r21g2000pri.googlegroups.com...
You could also generate the error message in a global variable using something like this:
{ SET errmessage { TOC \c "nonexistingfigurelabel" } }
and then use { REF errmessage } in the IF construct.
Stefan Blom
Microsoft Word MVP
"Suzanne S. Barnhill" wrote in message news:iclpt3$12c$1...@news.eternal-september.org...
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
"Stefan Blom" <Stefa...@discussions.microsoft.com> wrote in message
news:icrb98$kst$1...@news.eternal-september.org...
I'll have to continue my experiments with this tomorrow. :-)
Stefan Blom
Microsoft Word MVP
"Suzanne S. Barnhill" wrote in message news:icrkmi$27h$1...@news.eternal-september.org...
{ SET errmessage { TOC \t "nonexistingstylename" \c } }
And then use the IF field I suggested in a previous message.
Stefan Blom
Microsoft Word MVP
"Stefan Blom" wrote in message news:icrp9q$k30$1...@news.eternal-september.org...
Dear Suzanne and Stefan,
Thank you very much for your interest and quick answers. I (almost)
have the desired result. I mean, I have the desired customized message
when there are no entries in my TOC, and a TOC when there are some
entries. But the format of this TOC is not the same I got with the
original field.
The syntaxis I use now is
{ SET errmessage { TOC \h \z \t "My style" \c } }{ IF { REF
errmessage } = "
¡Error! No se encuentran elementos de tabla de ilustraciones." "My
customized text" "{ TOC \h \z \t "My style" \c }"}
(My computer and I speak Spanish, sorry for that)
I have had to include a carriage return in the standard error
message comparison with the REF field (I only discovered that after
some try and error). The " around the action in case the IF condition
is false seem to be optional.
The resulting TOC when there are entries is formatted in blue
underlined font, similar to a standard Hyperlink, instead of the
format of the original TOC in black font with some parts in bold and
so on.
Do you know if there is a way to control the format of this TOC? I
am going to read again the tutorials for TOCs by Suzanne and other
MVPs, but if you could point a particular link for this I would
appreciate it very much.
Thanks again for your help. It is a great luck for regular Word
users that people like you are helping us.
1. Don't hyperlink the TOC (omit the \h switch). Since page numbers will
still by hyperlinked, however, they may be formatted.
2. If you don't have any other hyperlinks in the document that you want
formatted as blue and underlined, modify the Hyperlink (and Followed
Hyperlink) styles to be just Default Paragraph Font instead of Default
Paragraph Font + Underline, Font color: Blue/Violet.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
"pum" <unai.sa...@gmail.com> wrote in message
news:eb752b60-d231-46ca...@q18g2000vbm.googlegroups.com...