Answered
[ExtendScript ] Creating a MiniTOC failed
I'm trying to create a MiniTOC, but I failed with this code:
var goDoc = app.ActiveDoc;
var gaMiniTocPgfFmts = ["Title1","Title2"];
var oTextRange = goDoc.TextSelection;
var oMTOCPgf = oTextRange.beg.obj
var oCursor = new TextLoc(oMTOCPgf,0);
var oMiniToc = goDoc.NewInlineComponentOfType(Constants.FV_MiniTOC,gaMiniTocPgfFmts,Constants.FP_InsertLinks,oCursor);FA_errno always is -1
I did it manually with the same unstructured document and was successful.
Has anyone managed to do that?
The documentation is very poor or non-existent.
