TOC Creation request
HI,
I have trouble to enable the "includeBookDocuments" and "removeForcedLineBreak", my code is here, but the resule was enabled "bookmarks" and "replace toc".
I need to enable "includeBookDocuments" and "removeForcedLineBreak" only.
kindly chec my code and correct me..
var tocStyles = ["style1","Style2","Style3"];
var doc = app.activeDocument;
var tocNewStyle = doc.paragraphStyles.add({name:"tempTOC", appliedFont:"Arial", fontStyle: "Regular", pointSize:2});
var myTOC = app.activeDocument.tocStyles.add();
myTOC.name = "MyTOCStyle";
myTOC.title = "Contents";
myTOC.titleStyle = app.activeDocument.paragraphStyles[3]; // enter the paragraph style to apply to the TOC title.
myTOC.includeBookDocuments = true;
myTOC.removeForcedLineBreak = true;
for(i=0; i<tocStyles.length; i++)
{
style = app.activeDocument.paragraphStyles.item(tocStyles[i]); // enter the paragraph style for "include paragraph styles"
myTOC.tocStyleEntries.add({formatStyle:tocNewStyle, name:style.name, separator:"\t"});
}
app.activeDocument.createTOC(myTOC);

