Previous | Next | (P-PDF) Beginners
Topic: Read Bookmarks with vb and javascriptobjects
Conf: (P-PDF) Beginners, Msg: 23618
From: MRembeck
Date: 7/10/2001 08:10 AM
Hello,
can everyone help me.
I can read the bookmark with vb6 but I don't know the function to read the count of bookmarks in the array ( bookmark.children.length dosn't work)
The next problem that I have is to find the last bookmark. When I use the code " bookmark2 = Bookmark(0).children" and there is no children I become an error message
What can I do to find the last bookmark ?
Thank you
My Code:
Dim OurPathFileName As String
Dim PDDoc As Acrobat.CAcroPDDoc
Dim jso As Object 'JavaScriptObject
Dim BookMarkRoot As Object
Dim Bookmark As Variant
Dim bookmark2 As Variant
OurPathFileName = "e:\steam\SMART\Test mit Acrobat-Controll\Acorbat-Files\reader.pdf"
Set PDDoc = CreateObject("AcroExch.PDDoc")
If PDDoc.Open(OurPathFileName) Then
Set jso = PDDoc.GetJSObject
Set BookMarkRoot = jso.BookMarkRoot
'1st hir
Bookmark = jso.BookMarkRoot.children
MsgBox Bookmark(0).Name
'2 hir
bookmark2 = Bookmark(0).children
MsgBox bookmark2(0).Name
End If