Skip to main content
Participating Frequently
June 24, 2008
Question

[CS3] Modifying TOC title?

  • June 24, 2008
  • 2 replies
  • 499 views
What's the proper way of approaching this?<br /><br />Inspired by SnpGenerateTOC.cpp:<br /><br />http://support.adobe.com/devsup/devsup.nsf/docs/53960.htm<br /><br />...I tried this:<br /><br />InterfacePtr<ICommand> fmtCmd( CmdUtils::CreateCommand( kFormatTOCCmdBoss));<br />if (fmtCmd)<br />{<br /> InterfacePtr<ITOCCmdData> fmtCmdData( fmtCmd, UseDefaultIID());<br /> if (fmtCmdData)<br /> {<br /> fmtCmdData->SetTargetItem( docUIDRef);<br /> fmtCmdData->SetTextModelUIDRef( tocStoryUIDRef);<br /> fmtCmdData->SetTOCTitle( tocTitle);<br /> }<br /> rc = CmdUtils::ProcessCommand( fmtCmd);<br />}<br /><br />...but the result was a new title above the original one! There's also the "place gun" issue, but at least there seem to be remedies for that (described in the "How to create a new TOC without having the user place it?" thread).<br /><br />(How is the command underlying the "Update Table of Contents" menu item implemented?)<br /><br />Many thanks in advance for any helpful comments!<br /><br />-Mark
This topic has been closed for replies.

2 replies

Participant
December 3, 2022

hi, how to use kFormatTOCCmdBoss

BobLevine
Community Expert
Community Expert
December 3, 2022

This discussion is almost 15 years old. If you have a question, please start a new discussion.

Participating Frequently
June 25, 2008
Perhaps it should be added that what I really need to do is (1) update an existing TOC, and (2) modify its title, but the following techdoc solved #1 for me:

http://support.adobe.com/devsup/devsup.nsf/docs/52857.htm

With regard to #2, I suppose the last resort is to find the first paragraph in the story and make the substitution there, but I'd much rather use the kFormatTOCCmdBoss (or other appropriate class)!

Any ideas?

-Mark