I'm going to go off on a tangent here.

   

Another role OneNote testers have is that of customer advocate. We are tasked with monitoring the OneNote newsgroup, the Customer Connection site, responding to customer feedback and using all of this information to make changes to our test plans for new features.

   

One request I saw on our newsgroup was a customer who had thousands of TXT files which he wanted to import into OneNote. He had apparently used Notepad for years to store data on his hard drive. Fair enough. But now he wanted to migrate to OneNote and was stuck. The only solution he had was to open them one at a time and copy and paste into OneNote. Clearly not ideal. Another person wanted to see some sample code to simply add some text to a page in OneNote.

   

I decided to write another powertoy to help both of these users. It will allow you to navigate to a folder on the hard drive and import all the TXT files in it to OneNote. It will create a new section with the name of the folder on the hard drive as the section name. And here I hit a snag. I never really liked the behavior of putting all new information into Unfiled Notes by default. While it makes sense most of the time, in this case I really saw a need to control where the imported text files would go. I decided to implement a tree control to let the user choose which notebook the files would be imported. So now you can choose into which notebook you want the imported files to go. And the second fellow who wanted to see the code for this can download the source.

 This importer currently only works for ANSI text.

Here are the links (corrected ZIP files as of April 3, 2007, and again on Feb 21, 2010)

Update 2:  fixed bug with new line characters not imported into OneNote correctly. 2/23/2009.  Details here.

Update 3: OfficeLive went away, so you can get the newest version here: http://blogs.msdn.com/b/johnguin/archive/2010/06/24/the-text-importer-powertoy-gets-updated-for-onenote-2010.aspx. 

Update 4: The source code is now here: http://blogs.msdn.com/b/johnguin/archive/2012/10/25/source-code-for-the-text-importer-for-onenote.aspx

If you want the source code, email me via the link in the upper right.  If I get enough requests, I will repost the code.

For the setup program: http://johnguin.web.officelive.com/documents/OneNote_Text_Importer_Setup.zip

And the source code (C#)  http://johnguin.web.officelive.com/documents/OneNote_Text_Importer_Source.zip

   

As always, let me know what you think.