Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-24-2024, 02:37 AM
Laurel Laurel is offline TOC with IF Condition Windows 10 TOC with IF Condition Office 2021
Novice
TOC with IF Condition
 
Join Date: Oct 2024
Posts: 2
Laurel is on a distinguished road
Angry TOC with IF Condition

Hello, a question about tables of contents with if conditions.



I have a document with chapters and subchapters. The document has two tables of contents: a short one (only the main heading) and a detailed one (with headings and page numbers). Now I want to ensure that the second detailed table of contents is not output if the short and detailed ones match.


I have the following field code:


{if {\TOC \t "Heading 2;1" \b inh_kap0_2 \o "2-2" \n "1-1" } =
{\TOC \t "Heading 2;1;Heading 3;2" \b inh_kap0_2 \o "2-3" \n "1-1" } "" {\TOC \t "Heading 2;1;Heading 3;2" \b inh_kap0_2 \o "2-3"
\n "1-1" \* mergeformat}}


This works very well. Now I would like to create a detailed and linked table of contents. But, if I add the \h switch, so


{if {\TOC \t "Heading 2;1" \b inh_kap0_2 \o "2-2" \n "1-1" } =
{\TOC \t "Heading 2;1;Heading 3;2" \b inh_kap0_2 \o "2-3" \n "1-1" } "" {\TOC \h \t "Heading 2;1;Heading 3;2" \b inh_kap0_2 \o "2-3"
\n "1-1" \* mergeformat}}


There is still no link.

I read that in \toc fields with if conditions the \h doesn't work. Is there another way to do this anyway? To reach links in the table of contents? Or works that, if at all, only via VBA code?


Thank you for your support.
Laurel
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
sumProduct with OR condition ShostyFan Excel 7 10-16-2019 02:19 PM
TOC with IF Condition If condition not working. jhansrod Word VBA 8 06-15-2019 05:59 AM
TOC with IF Condition How to use if condition to for this ... LearnerExcel Excel 1 12-19-2016 02:14 PM
TOC with IF Condition check with condition karti Word 2 03-15-2011 06:06 AM
Retrict Method Condition markp Outlook 0 12-22-2005 05:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08: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