Share via

OneNote 2013 library reference

Anonymous
2014-05-28T10:09:03+00:00

hello everyone

I've following code, by which I continously have this error: "User-defined type not defined" (referred to first row).

I've these references, and Office 2013 (office 365) installed on my PC:

  • Microsoft XML, v6.0
  • Microsoft OneNote 15.0 Object library
  • Microsoft OneNote 15.0 Extended Object library

What's wrong? I can't understand.

thanks

Private Function GetFirstOneNoteNotebookNodes(OneNote As OneNote15.Application) As MSXML2.IXMLDOMNodeList

    ' Get the XML that represents the OneNote notebooks available.

    Dim notebookXml As String

    ' OneNote fills notebookXml with an XML document providing information

    ' about what OneNote notebooks are available.

    ' You want all the data and thus are providing an empty string

    ' for the bstrStartNodeID parameter.

    OneNote.GetHierarchy "", hsNotebooks, notebookXml, xs2013

    ' Use the MSXML Library to parse the XML.

    Dim doc As MSXML2.DOMDocument

    Set doc = New MSXML2.DOMDocument

    If doc.LoadXML(notebookXml) Then

        Set GetFirstOneNoteNotebookNodes = doc.DocumentElement.SelectNodes("//one:Notebook")

    Else

        Set GetFirstOneNoteNotebookNodes = Nothing

    End If

End Function

Microsoft 365 and Office | Install, redeem, activate | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2014-05-29T09:36:42+00:00

    Solved!

    It was enough to replace "OneNote15.Application" with "OneNote.Application".

    Untill Office 2010 (14) it was "OneNote14.Application".

    Thanks to everyone

    Was this answer helpful?

    5 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2014-05-29T05:26:12+00:00

    Was this answer helpful?

    0 comments No comments