OneNote API & DocumentElement.SelectNodes Namespace

%3CLINGO-SUB%20id%3D%22lingo-sub-1981819%22%20slang%3D%22en-US%22%3EOneNote%20API%20%26amp%3B%20DocumentElement.SelectNodes%20Namespace%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1981819%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20work%20out%20how%20to%20run%20a%20bit%20of%20sample%20code%20that%20is%20found%20here%3A%26nbsp%3B%3CA%20title%3D%22OneNote%20API%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Foffice%2Fdeveloper%2Foffice-2010%2Fhh377183(v%3Doffice.14)%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Foffice%2Fdeveloper%2Foffice-2010%2Fhh377183(v%3Doffice.14)%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20had%20to%20change%20parts%20of%20the%20code%20in%20order%20for%20it%20to%20run%20since%20it%20seems%20to%20be%20outdated%20(this%20was%20from%20the%202010%20reference).%26nbsp%3B%20The%20part%20I'm%20currently%20stuck%20on%20is%20giving%20me%20an%20error%20regarding%20the%20namespace%20being%20incorrect%20in%20this%20line%3A%26nbsp%3B%26nbsp%3BSet%20GetFirstOneNoteNotebookNodes%20%3D%20doc.DocumentElement.SelectNodes(%22%2F%2Fone%3ANotebooks%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20is%20the%20correct%20query%20string%20to%20enter%2C%20rather%20than%20%22%2F%2Fone%3ANotebooks%22%3F%26nbsp%3B%20Thanks.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1981819%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOneNote%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EVba%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

I am trying to work out how to run a bit of sample code that is found here: https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/hh377183(v=office.14... 

 

I have had to change parts of the code in order for it to run since it seems to be outdated (this was from the 2010 reference).  The part I'm currently stuck on is giving me an error regarding the namespace being incorrect in this line:  Set GetFirstOneNoteNotebookNodes = doc.DocumentElement.SelectNodes("//one:Notebooks")

 

What is the correct query string to enter, rather than "//one:Notebooks"?  Thanks.

 

0 Replies