1 Reply Latest reply on Jun 25, 2011 12:36 PM by qidanei

    Help!Why do I get Error-Report from running this VBScript?

    qidanei

      When I run the following ShowAllBookMark.vbs , i get an Error-Report:  Object doesn't support this property or method:'BMRoot.children

       

      The ShowAllBookMark.vbs is to display all the bookmark in abc.pdf...

       

      where is the error? And how to correct it?

       

      *********************************ShowAllBookMark.vbs************************************** *******

       

      Function GetAllBookMarksTitle(str,BMRoot)

      BMRs=BMRoot.children

      For each ele in BMRS
      str = str+ele.Name
      GetAllBookMarksTitle  str,ele
      Next

      End Function


      set AcroApp=CreateObject("AcroExch.App")
      set pdf=CreateObject("AcroExch.PDDoc")
      pdf.Open("D:\abc.pdf")

      set jso = pdf.GetJSObject
      set BMarkRoot=jso.BookMarkRoot

      Dim allTitles

      GetAllBookMarksTitle   allTitles,BMarkRoot

      MsgBox   allTitles
      *********************************************************************************

        • 1. Re: Help!Why do I get Error-Report from running this VBScript?
          qidanei Level 1

          The following is a second version,but i get error-report: Type mismatch

          Why?

          *******************************************************

          Function GetAllBookMarksTitle(str,BMRoot)

          BMRs=BMRoot.children

          For each ele in BMRS
          str = str+ele.Name

          If(ele.children=null)Then

          Else
          GetAllBookMarksTitle  str,ele

          End If
          Next

          End Function


          set AcroApp=CreateObject("AcroExch.App")
          set pdf=CreateObject("AcroExch.PDDoc")
          pdf.Open("D:\abc.pdf")

          set jso = pdf.GetJSObject
          set BMarkRoot=jso.BookMarkRoot

          Dim allTitles

          GetAllBookMarksTitle   allTitles,BMarkRoot

          MsgBox   allTitles

          *******************************************************