The text importer powertoy gets updated for OneNote 2010


I saw a tweet a few days ago which mentioned that someone would have “no more thousands of text files” now that she was moving to OneNote. I just missed saving a copy of that tweet, but the thought reminded me of a powertoy I wrote a few years ago that imports all the text files in a folder into a new section. It was designed to help folks move from “piles of TXT files” into OneNote quickly. I only used it once myself (once I moved all my stuff into OneNote I did not repeat the process) and then forgot about it.

Anyway, this tweet served as inspiration to update this for OneNote 2010. I literally only had to do the steps from my previous article. I added a link to this blog, though, and changed the text on the window for it to mention OneNote 2010. The download is below – there is still no install. Just unzip the file and run the tool. Otherwise, it works just like the original. Here’s a screenshot to get you started:

clip_image001

Browse to the location with your text files then select which notebook should get the new section added to it. The name of the new section will be the same name as the folder which held the text files.

The code is functionally unchanged from the OneNote 2007 version so I won’t include it here. You can get it from the original version (link above) if you want it.

Enjoy!

Questions, comments, concerns and criticisms always welcome,

John

OneNote 2010 Text Importer.zip


Comments (77)

  1. Maria says:

    Thank you. This can be very useful. Does it only work with text files? I have a tons of jpg files (pictures of all my handwritten notes etc.) is there an easy way to transfer those?

  2. John says:

    Only text files (and plain text, at that).  the source code is available if you want to adapt it to your needs.

  3. Maria says:

    Thank you for the reply. I wish I knew how to do programming. Alas, I don't:))

    So, there is no other easy way to transfer a big batch of .jpg files?

  4. Vilis says:

    I have just started using OneNote and have several 1000 files from another organizer-type program – this powertoy is just what I need. Thanks.

  5. John says:

    For bulk importing, you may want to try autohotkey.  www.autohotkey.com – it's not all that complicated to setup.

  6. DominicBernath says:

    is there anything similar that can import pdf? now i know the "print" to onennote function. but this is not what i want to do. im looking for something that can import the text of a pdf into onennote (as text).

    thanks

  7. JohnGuin says:

    No solution for PDF that I know.  Can you save PDF as text files then import here (not sure if that is possible either).

  8. kojakk says:

    Thanks John, I just can't understand why they left this feature out.

  9. Basti says:

    Did you use unicode? The german letters (eg. äöü) are displayed incorrectly.

  10. John says:

    Basti – no, this is ANSI only.  Converting to unicode would mean writing this to convert the ANSI to HTML and importing that into OneNote.  I kept it simple, but the code is available should anyone want to update it in the future.

  11. I try to run the tool and I recieve the following error.  I e-mailed you directly about this John but left out this error log information.  Running windows 7 Ultimate 64 bit with office 2010 in 32 bit mode.  Have applications that need it to run as a 32bit application.  

    Unable to cast COM object of type 'Microsoft.Office.Interop.OneNote.ApplicationClass' to interface type 'Microsoft.Office.Interop.OneNote.IApplicationCOM'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{452AC71A-B655-4967-A208-A4CC39DD7949}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

  12. Uddhav says:

    In choose notebook, it does not display any info…..help please

  13. JohnGuin says:

    There should be a log file in the folder where you ran the application.  What are the contents of that log?

    And if you click File | Help, what version of OneNote do you have listed on the right?

  14. uddhav says:

    I can give you access to my computer, let me know

    we can chat via skype

  15. uddhav says:

    I can now see hte Notebooks with + sign,  but, when I ran it says Onenotes Stopped working

  16. uddhav says:

    Microsoft Office Professional Plus 2010

    14.0.6112.5000 (32 bit )

    Windows OS : 7

    64 bit

  17. uddhav says:

    OK, here is some results

    I'm able to import if fie size is about 200K or 500K,

    but nothing happened to 7MB file size

    Now when I have muliple pages, in Outlook notes; after export to OneNotes, it dumps everything to one page. How do I duplicate this as it is in Outlook – in multiple pages

  18. uddhav says:

    System.Runtime.InteropServices.COMException (0x80042000): Exception from HRESULT: 0x80042000

      at Microsoft.Office.Interop.OneNote.ApplicationClassCOM.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

      at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent_AutoBusyRetry(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

      at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified)

      at Text_File_Importer.FormTextImporter.buttonImport_Click(Object sender, EventArgs e)

  19. JohnGuin says:

    OK, let me see if I can find out what is happening with large files.

  20. uddhav says:

    Also, why all the notes and dump into one page ? I thought it would create a similar multi page notes

  21. uddhav says:

    John,

    Any update :

    a) the big size file does not work

    b) it dumps everything to one note

    c) when I use OneNote2010 to publish to SkyDrive, why it does not show me my section, pages , subpages etc  ????  Also, if I have the multiple notes ,  it also does not show that as well…..also, where is the search section in SkyDrive version ? If MS is planning to go everything cloud, in Office 2015,  then,  these should be corrected…..,  I use the same computer to connect to SkyDrive. Once connected, even if I say, open in local OneNote2010,  it does not open the local OneNote2010 version …..  ???  It says, you do not have new version of 2010 or your version is too new…….what is going on  ??????

  22. Uddhav says:

    Any update ?

  23. JohnGuin says:

    Uddhav, I looked through the code and files of less than 2GB should work.  Can you use the email link in the upper right to contact me?  I'm going to need the log file the tool creates from your machine and a sample file that is causing the problem.

    What language are you using?

  24. Chris says:

    Dear John,

    thanks for this awesome tool! Exactly what I needed, since I too am migrating thusands of textfiles in folders and subfolders into onenote.

    And right here's my issue: The current version of your tool seems to not import files stored in subfolders. In your update from 2009, you included this function, but the current version only regarded the files in the actual folder.

    Any ideas?

    Thanks a lot!!

  25. John says:

    Yep, it should be importing from the subfolder.  Only ideas I have about this not working would be read only subfolders, the subfolder has some corruption or some other odd scenario like that.

    How long is the path to the subfolder, and how many files does it have?

    And how long is the path to the section to which you are importing the files?

  26. Darryl Milligan says:

    It sounds great. Is the OneNote 2007 version still availible?

  27. John says:

    Yes, it is at blogs.msdn.com/…/customer-feedback-results-in-another-powertoy.aspx

    And notice how often the files got moved from server to server 🙂

  28. Same issue -- interop error says:

    This is on Windows 7 Ult 64-bit, Outlook/OneNote 2010 32-bit

    Outlook and OneNote are both ver. 14.0.6123.5001

    Exception from HRESULT: 0x80042020

    System.Runtime.InteropServices.COMException (0x80042020): Exception from HRESULT: 0x80042020

      at Microsoft.Office.Interop.OneNote.ApplicationClassCOM.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

      at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent_AutoBusyRetry(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

      at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified)

      at Text_File_Importer.FormTextImporter.buttonImport_Click(Object sender, EventArgs e)

  29. John says:

    That error means the schema is invalid.  Are you trying to import into a notebook in 2007 format (does it say "Compatibility Mode" across the top)?

  30. Dave M says:

    Having issues importing.  Windows 7, 64 bit.  

    Notebooks are not available to choose from in the import to section.  Tried importing anyway, and it just gives me an error.  

    Do I need to have one note running?

  31. John says:

    You should not need OneNote running, but I never tested to see if the needed COM objects could start quickly enough.  I'd try with OneNote running first.

    What error are you getting?

  32. Dave M says:

    When the power toy runs, I don't get an option to select the notebook to import to.  If I continue and click import anyway, I get an unhandled error: "Object reference not set to an instance of an object".  

  33. John says:

    What version of OneNote do you have?

  34. Ali says:

    Should the Text File Importer tool work with OneNote 2013?  I managed to export all my Outlook notes to Text files.  But now when i run the Text File Importer tool, it creates the Section based on the Folder name, but only creates one blank, untitled page and gives the following error in the log file.

    System.Runtime.InteropServices.COMException (0x80042001): Exception from HRESULT: 0x80042001

      at Microsoft.Office.Interop.OneNote.ApplicationClassCOM.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

      at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent_AutoBusyRetry(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

      at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified)

      at Text_File_Importer.FormTextImporter.buttonImport_Click(Object sender, EventArgs e)

  35. John says:

    It should work fine.  Can you share the text files you are trying to import?

  36. I'm not sure how to share the text files, but I have one I created in Notepad, it resides in C:MyOutlookNotesTest, and contains just the line:

    Testing Text File Importer tool

    The Text File Importer tool creates a tab called Test and a blank Untitled page.  It doesn't import the body of the text file.

  37. John says:

    Are you using OneNote 2010?  And you can contact me via email by using the link at the upper right.

  38. Keith L. says:

    Hi John, I'm seeing the same thing as Ali above, with OneNote 2013 (not 2010):  Importer runs, I'm able to select a notebook, new section runs, but no pages are created.

    Did you ever figure this out?

  39. John says:

    Yes, the text importer is specific to the version of OneNote you are using.  I have not updated it for 2013 yet.  Send me an email from the upper right if this is a large problem, though, and I'll see what I can do.

  40. Kay says:

    Any fix onenote 2013 yet?

    i have over 500 notes that i converted to text files from outlook notes.

    Can't believe microsoft included a 'send to onenote' button for email, but it doesn't work for NOTES.. you can send NOTES to oneNOTE but you can send email..

    anyway, any help will be much appreciated!! i can help pore over the code if you can tell me what i should be looking for.

  41. Greg says:

    It would be fantastic to have an updated version for One Note.

  42. JustAFan says:

    Thanks, I love you, this software saved me a lot of time! Thanks again. Also, thanks.

  43. Phil says:

    Any news for Outlook 2013 / OneNote 2013 tool ?

  44. Ruben says:

    Unfortunately this doesn't work. I have W7 64 bit, OneNote 2010. Nothing happens and the following error is shown in a text log file:

    System.Runtime.InteropServices.COMException (0x80042000): Exception from HRESULT: 0x80042000

      at Microsoft.Office.Interop.OneNote.ApplicationClassCOM.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

      at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent_AutoBusyRetry(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

      at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified)

      at Text_File_Importer.FormTextImporter.buttonImport_Click(Object sender, EventArgs e)

  45. Ruben says:

    Unfortunately this doesn't work… But I guess we are used to Microsoft products not working anyway.

    I am using Windows 7,64bit with OneNote 2010. I have tried importing into a local Notebook and a web/online Notebook and the result is the same: NADA

    The error log shows this message:

    System.Runtime.InteropServices.COMException (0x80042000): Exception from HRESULT: 0x80042000

      at Microsoft.Office.Interop.OneNote.ApplicationClassCOM.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

      at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent_AutoBusyRetry(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

      at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified)

      at Text_File_Importer.FormTextImporter.buttonImport_Click(Object sender, EventArgs e)

  46. John says:

    I've seen this and am trying to troubleshoot.  It's slow going – probably something very obvious, I just have not been able to isolate the problem…

  47. Salim says:

    Hi John,

    Great work on this – much needed.   Have you managed to resolve issue with transferring notes from exported files into onenote? importer doesn't work on my W7 64bit either.

    thanks will hopefully get a fix soon.

  48. John says:

    Hi all,

    I think I have the problem fixed.  Can you email me via the link in the upper right corner?  I can send you a "beta" version to ensure it works, then post it here once I get some independent validation.  Sorry for the delay here.

  49. Corey says:

    Did you solve this problem?  I got the same Exception from HRESULT: 0x80042000 error when I tried out the code in VS express 2010 using OneNote 2010.  I fixed it by changing the reference to OneNote 14.0 and the xml namespace string's date from 2007 to 2010 to fix it.

  50. Corey says:

    I got the same exception (0x80042000) testing the code for the bulk importer using VS Express 2010 and OneNote 2010. I had to change the OneNote reference from 12.0 to 14.0 and the namespace date from 2007 to 2010 to fix it.

  51. John says:

    Yep – that is how to update addins from 2007 to 2010.

  52. Mark says:

    I tried this on my XP system …

    I downloaded and unzipped the exe file.  Clicked on it and … nothing.

    Any ideas?

  53. John says:

    There should have been a log file created in the same folder where you ran the EXE.  Did you copy the exe to a permanent folder?  And what is in the log file?

  54. Flavior says:

    Thank you for your tool, it worked well for me.

    May I see the source code, so I can try to extend it for importing binary files?

  55. John says:

    Email me (link is in upper right) and I can send you the code.  Also, see this as well for binary content on a page: blogs.msdn.com/…/looking-at-the-code-for-the-image-importer.aspx

  56. Dave says:

    Just tried your program.  So far, so great!

    Thought I should thank you now, in case I get so busy hunting down text files that I forget to be grateful later.

    Thanks!

  57. Patty says:

    Hi .. I just tried the import program and I'm getting the section created for "MyOutlookNotes" in OneNote, which is the name of the folder the export macro created containing all the txt files for each note … but I'm not getting any of the individual Notes created as a page.  

    I am getting the following in the log file for OneNoteTextFile_Importer_error_log:

    System.Runtime.InteropServices.COMException (0x80042001): Exceiption from HRESULT: 0x80042001

    at Microsoft.Office.Interop.OneNote.ApplicationClassCOM.UpdatePageContent(StringbstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

    at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent_AutoBusyRetry(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified, XMLSchema xsSchema, Boolean force)

    at Microsoft.Office.Interop.OneNote.ApplicationClass.UpdatePageContent(String bstrPageChangesXmlIn, DateTime dateExpectedLastModified)

    at Text_File_Importer.FormTextImporter.buttonImport_Click(Object sender, EventArgs e)

    Appreciate any help you can provide in troubleshooting this …. I'm using Windows 7 64bit and Outlook 2013.

    Thanks!

  58. JohnGuin says:

    One dumb limitation I forgot is that the DLL has to be in the same folder as the EXE file – can you double check that to make sure they are together?

  59. ktmmojo says:

    My contribution…..I had about 150 Outlook Notes that I wanted to pull into OneNote 2013.  I found this URL ( http://www.howtogeek.com/…/import-evernote-files-into-ms-onenote-2010 ) and this gave me the idea that I used which was successful.  It wasn't exactly what I wanted but it did work and I couldn't spend anymore time on this.  I would agree with other folks who have posted comments that this is completely RIDICULIOUS that there's not a better way to do this.  Not a good move in trying to get folks to use your product.

    From Outlook, I would select the Notes folder that I wanted to export over, select every Note within that folder and then select to Forward it to an email address.

    Save it as a draft.

    Go into your draft folder, right click on the draft and then Select OneNote (this will bring up the GUI of where you want to save it within OneNote)

    You'll find the Notes moved into OneNote as an icon which you can then open and view (and this is the part that isn't what I was looking for but at least I have the data and I can go back later and cut/paste it into the format that I was expecting).

    I hope this helps someone who's spent as much time as I have in trying to do this.  I followed the directions above but I was unable to convert the TXT files (from my Outlook Notes folders) into OneNote using the TXT conversion tool.  It would run but nothing came over and the log file was empty.

  60. JohnGuin says:

    Not 100% on topic, but you can now email to "me@onenote.com" to send email directly to OneNote.  Details at http://www.onenote.com

  61. Patty says:

    Hi John … appreciate you taking the time to respond on this … I can gaurantee that the exe is not anywhere near any DLL :).  It is just in the Downloads folder …

    What DLL are you referring to, so I can make sure I have the exe in the same folder?

    Thanks!

    Patty

  62. JohnGuin says:

    The zip file should have the DLL in it – let me know if it is not there.  2013 version, right?

  63. Tom says:

    Hi John, I have the output from your VBA successfully created thanks to your earlier help. The above application permits entry of the source folder, but doesn't "open" the dialog box for the target Notebook. I have OneNote 2013.

  64. Tom says:

    UPDATE:  John, Don't know what I did but the dialog box now allows me to select the Notebook. However, the net result was that a new Notebook folder was created with the correct name and four untitled pages with NO contents (the source had 11 pages). Total source folder content size is very small. Can't find a dll file, but maybe I just don't know where to look. The unzipped app is saved in Downloads.

  65. BND says:

    This works amazingly well and saved a heck of a lot of time.

    However, I was a little dissapointed OneNote wasn't able to pick up the orignal date time information from the txt files?

    Any way of doing this?

  66. chuck says:

    Thankyou for your service.

    this function works well but only Eng.

    I am not English speaker and writer.

    Do you have any plan to fix and suports to other language ( BY UNICODE) ?

  67. Millard says:

    I've tried it twice with OneNote 2010 on an Asus laptop, it crashed OneNote both times. Please contact me millardjmelnyk@gmail.com

  68. Tom Leith says:

    Thanks for this tool — I did get it to work. It does not recurse folders and it seems necessary to choose a folder — it doesn't seem to put them in "unfiled" if you don't. But it works well enough.

    I can't believe it is this much trouble to convert Outlook notes into OneNote. It is done now, so I'll start to explore its features. Thanks again.

  69. Eugene Mayevski says:

    Just a small note – on a brand new Windows 8.1 the tool doesn't run and gives no error. It appears that the supposedly preinstalled .NET Framework 4.5.1 is not enough. I have downloaded and installed .NET 4.5.2 from Microsoft site and after this the tool worked.

    Another problem is non-latin ANSI text in notes – it would be great if the tool could ask what charset to use during the import, but maybe I am asking too much.

    Thank you for the job! 🙂

  70. Christian says:

    This is a brilliant tool. I have some markdown files (*.md). I tried to run the tool, but it was looking for .txt file, wrote a quick script to rename the extension to .txt and then the import worked just fine.

    A quick question, does it allow to import html file? I have some html documentation files with pictures that I want to import into Onenote.

    thanks John again.

  71. JohnGuin says:

    No, no HTML.  That was something I never had time to tackle – I think you would need to run it through an HTML to RTF converter and then use the RTF that resulted.

  72. Chrsitian says:

    John,

    so can it handle .rtf file? Hmmm. i did not know that. Would it also handle the images in the rtf file?

    Btw, you mentioned somewhere in your other post about the files in sub folders? Is it working too? For example, if I am importing txt files as follows:

    root directory

    test1.txt

    test2.txt

    subfolder

     test3.txt

     test4.txt

    Thanks.

  73. Carl says:

    From my testing, the addon does not appear to handle RTF. I get a "there are not text files" error when I try.

  74. JohnGuin says:

    Correct – text only.  Getting RTF to work would have meant implementing a rtf to html routine (which are available) but I never had time for that.

  75. Ken says:

    Where I can download the dll file? It is not included in the zip file. Thanks.

  76. Bev says:

    Any chance of updating this for Notes 2016 pretty please? Hundreds of notes to copy and paste otherwise 🙁

    Thanks

  77. Geene says:

    Hi John,

    Thanks for taking the time to write/post your program.  It was very helpful to me.

    Gene

Skip to main content