1 person found this helpful
You looked in the right place, but might have overlooked this:
Array of Story createTOC (using:TOCStyle[, replacing:bool=false][, fromBook:Book][, placePoint: Array of number][, includeOverset:bool=false][, destinationLayer:Layer])
replacing (bool) If true, replaces the existing TOC. (Optional) (default: false)
Sounds like all you need to add is
document.createTOC([your toc style], true);
That's exactly what I needed. Thanks!
I have a script that does this in vb but am getting the strangest result. It runs and replaces my TOC, but the contents are blank. When I then select that same TOC frame and manually select Layout>Update Table of Contents, it updates and fills in the info.
Here is my code.
set myInDesign = CreateObject("InDesign.Application.CC.2015") myInDesign.ActiveDocument.CreateTOC myInDesign.ActiveDocument.TOCStyles.Item("QR TOC US"), True
Any idea what might be causing this?