HTH, Reinhard
//---------------------------
function Dump(bm)
{
console.println(bm.name);
bm.execute;
console.println(this.pageNum);
if (bm.children != null)
for (var i = 0; i < bm.children.length; i++)
Dump(bm.children[i]);
}
//---------------------------
Dump(this.bookmarkRoot);
//---------------------------
is not the TOC. It returns the list with name of the bookmark and the number of page on which current document is opened - the constant value. :(
var f=""
function DumpBookmark(bm, nLevel)
{
var s = "";
for (var i = 0; i < nLevel; i++)
bm.execute();
p = this.getPageLabel(this.pageNum);
s += " ";
f += (s + bm.name +"..." + p + "\n");
app.alert(f);
if (bm.children != null)
for (var i = 0; i < bm.children.length; i++)
DumpBookmark(bm.children[i], nLevel + 1);
}
DumpBookmark(this.bookmarkRoot, 0);
HTH, Reinhard
bm.execute();
And now it works.
Thanks!