

Set GetFirstOneNoteNotebookNodes = Nothing Set GetFirstOneNoteNotebookNodes = ("//one:Notebook") OneNote.GetHierarchy "", hsNotebooks, notebookXml, xs2010 ' To get all the data, provide an empty string ' Fill notebookXml with an XML document providing information ' Get the XML that represents the OneNote notebooks available. Private Function GetFirstOneNoteNotebookNodes(oneNote As OneNote14.Application) As MSXML2.IXMLDOMNodeList MsgBox "OneNote 2010 XML data failed to load." ' XML hierarchy data for the searched item. ' If no search items are found, the XML contains the ' Output the returned XML to the Immediate Window. OneNote.FindPages notebookID, searchString, searchResultsAsXml, False, False, xs2010 ' This example instructs OneNote to return the XML data in the 2010 schema format. ' the User Interface to show the found items (this example passes False). You can also choose whether OneNote enables You can control whether OneNote searches non-indexed data (this ' provided as an XML document listing the objects where the search You provide the search string and the results are ' The FindPages method search a OneNote object (in this example, the first SearchString = InputBox$("Enter a search string.", "Search", "Microsoft") ' with a default search string of "Microsoft". ' Ask the user for a string for which to search Set nodes = GetFirstOneNoteNotebookNodes(oneNote) I found a better VBA example, titled "Programmatically Searching in OneNote 2010": Sub SearchTermsInTheFirstNoteBook() GetAttributeValueFromNode = (attributeName).Text Private Function GetAttributeValueFromNode(node As MSXML2.IXMLDOMNode, attributeName As String) As String MsgBox "OneNote 2010 XML Data failed to load." PageName = ("name").Textĭebug.Print "Page name: " vbCrLf & " " & pageNameĬall oneNote.GetPageContent(GetAttributeValueFromNode(node, "ID"), pageContent, piBasic) ' out to the Immediate window of your VBA host. ' Find all the Page nodes in the one namespace. ' Use the MSXML Library to parse the XML. OneNote.GetHierarchy "",, oneNotePagesXml, xs2010 ' oneNotePagesXml gets filled in with an XML document providing information ' Get the XML that represents the OneNote pages ' OneNote will be started if it's not running. ' Modified to get all pages & content instead of the notebook list ' - Microsoft OneNote 14.0 Object Library Modified MSDN Example: 'Add the following references (adjust to our office version): The page content is XML so you would have to parse that. I have modified the example source to retrieve all pages and the page content. It is written for OneNote 2010 and works for my Office 2010 package, but I hope it works on 2007 also. I retrieves a list of all OneNote notebooks.
Excel vba soundnote code#
This VBA example code on MSDN might help you. Can another point me in the right direction? MSDN has a developer site for Office and OneNote but I must be blind to not see any examples or even an object model! I just cant find any example of automation using OneNote 2010 (either from the OneNote side nor the Excel side). I dont want to go the OCR route because I need the accuracy that I think I can get from some sort of Office Automation between Excel and OneNote. I figured it would be easier than data entry or cheaper than hiring someone to key all this in by hand. I can write the VBA code, that isnt the problem.


But it might be on different lines or even pushed over, etc. The data is semi-structured, meaning that once I find "Order Number" I know there is a space character and then the order number follows. I need to get the pertainant details (Receipt #, Receipt Date, Amount, all of the line item data, tax, etc) out of each and I want to create a sheet in Excel with that data. Each notebook tab contains a different receipt. I would like to use VBA in Excel 2007 to step through about 500 receipts, which have been converted to one large OneNote 2010 notebook.
