Question
[CS3] Modifying TOC title?
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
