Thread: [Solved] TOC with IF Condition
View Single Post
 
Old 10-24-2024, 04:45 AM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,381
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

As you've discovered, the \h switch doesn't work inside an IF statement. I don't believe there's a field coding workaround for what you're trying to do.

A macro could be used to compare the two Tables of Contents and delete or hide the second one if they match, but that's probably about as far as you could go
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote