Today, we’re releasing the OneNote14 C++ header file which should make it easy for you to build OneNote add-ins. You can find the header file attached to the bottom of this post. Here’s a quick example demonstrating how you could use the header file to get XML representation of the OneNote Hierarchy .
1.) Open Visual Studio and create a New C++ Win32 Console Application
2.) Download the header file, and copy it into your project folder with the C++ source files
3.) The following sample code, taken from the OneNote12 header post should still work, and output the XML hierarchy data of all open notebooks in your OneNote client. Just paste it into your newly created project and run it:
int _tmain(int argc, _TCHAR* argv)
CLSCTX_LOCAL_SERVER, __uuidof(IApplication), (void**)&piOneNote);
HRESULT hr = piOneNote->GetHierarchy(NULL, hsNotebooks, &temp);
Here are some other resources that you might find useful: –