none
Search pages in OneNote programmatically (only in one Notebook)

    Question

  • Hi All.
    I can not limit the search scope to "Notebook" in OneNote.

    If execute the next code:

                string xml;

                var xnm = new XmlNamespaceManager(new NameTable());
                xnm.AddNamespace("one", "http://schemas.microsoft.com/office/onenote/2010/onenote");    
                var oneNoteApp = new Microsoft.Office.Interop.OneNote.Application();
                
                oneNoteApp.GetHierarchy(null, HierarchyScope.hsNotebooks, out xml);
                var notebookId = (string)XDocument.Parse(xml).Root.XPathSelectElement("one:Notebook", xnm).Attribute("ID");

                oneNoteApp.FindPages(notebookId, "test", out xml, true, true);

    The OneNote will start searching in all notebooks. :(

    Monday, November 19, 2012 5:35 AM

All replies

  • Hi Alexander,

    Thanks for posting in the MSDN Forum.

    I will involve some experts into your thread to see whether they can help you. There might be some time delay, appreciate for your patience.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, November 21, 2012 2:09 AM
  • Is this the bug of OneNote?
    Friday, December 07, 2012 7:25 AM