Welcome to MSDN Blogs Sign in | Join | Help

Donovan Lange's Work-Blog

My name is Donovan Lange. I'm a Software Design Engineer on Microsoft Office OneNote. This is my work-blog, a place to talk about OneNote, Microsoft, and programming. Geeky stuff. I also keep a life-blog, for the "other" things in my life.
Caution: addictive material! Handle with care.

It was more difficult than we expected. Our fingers are exhausted, and we won't even talk about the truly frightening quantities of Mt. Dew that were consumed. The end result: a shiny pile of ones and zeros we think you'll want to meet.

Previously I hinted that Omar, David and myself have been collaborating on a nicely abstracted managed assembly that provides an object model for importing data into OneNote. But as of today, it lives!

So what does it do, you ask? Enough talk:

using Microsoft.Office.OneNote; 
namespace Example
{
   class TrivialImport
   {
      public static void Main()
      {
         // Create a new page in the section "General", with the
         // title "Import Example".

         Page p = new Page("General.one", "Import Example");

         // Create a new Outline, and add some content to it:
         OutlineObject outline = new OutlineObject();
         outline.AddContent(new HtmlContent("Hello <i>world</i>!"));


         // Add the outline to our page:

         p.AddObject(outline);


         // Commit the changes to OneNote, and set the actively viewed page:

         p.Commit();
        p.NavigateTo();
      }
   }
}

Try it out for yourself: the assembly, source code, documentation, and class diagrams are all available for download here.

(Note that this is a work in progress, and as a result you may encounter the occasional bug or two. So if it eats your homework, erases all of your Tivo'd episodes of Friends, or breaks up with your girlfriend -- you have been warned. Of course, if this does occur, let me know.)

Go wild; but be careful: once you start importing, it's hard to stop.

[3/22/06: Updated URLs to point to new site.]

Posted: Thursday, June 17, 2004 10:06 PM by DoLange
Filed under:

Comments

Omar Shahine's WebLog said:

# June 18, 2004 1:25 AM

Andrei's Blog said:

# June 18, 2004 3:14 AM

WWs Blog said:

OneNote managed API
# June 18, 2004 4:47 AM

WWs Blog said:

OneNote managed API!
# June 18, 2004 4:50 AM

rohancragg - dotNet Blog said:

OneNote Managed API
# June 18, 2004 6:30 AM

V said:

Hmmmm... I tried that sample, and it crashes with:
Unhandled Exception: Microsoft.Office.OneNote.ImportException: OneNote is not installed on this machine!
at Microsoft.Office.OneNote.SimpleImporter..ctor()
at Microsoft.Office.OneNote.Page.Commit()
at Example.TrivialImport.Main()

What am I missing?
# June 18, 2004 6:58 AM

Donovan Lange said:

Do you have the OneNote SP1 Preview installed? (If not, you can download it from: http://www.microsoft.com/office/onenote/sp1/) DataImport is a new feature of the SP1 release.
# June 18, 2004 12:15 PM

Loosely Coupled said:

# June 18, 2004 3:43 PM

Loosely Coupled said:

# June 18, 2004 3:45 PM

Jeff Borlik said:

Nice job, Donovan. It certainly makes developing for OneNote much easier. Thanks!

Question, though: What kinds of HTML tags are valid for import into OneNote? (I suppose that this would apply to the COM and command-line as well.) Is that documented somewhere? Bold and italic work, obviously, but support for some other tags seems to be spotty.
# June 24, 2004 10:54 PM

Donovan Lange said:

Unfortunately, the set of supported html tags isn't well documented anywhere officially. (This is something that I can try to remedy as we prepare to ship.) I should mention that for those experimenting, you may notice that the html support is exactly the same as pasted html content from the clipboard. They're actually one and the same, so if it works when you copy and paste from IE, it should also work via an Import.

That being said, one of the goals of the C# classes posted here is to work around some of the nuances (which is the polite way of saying bugs) of the underlying COM interface. You'll notice that we already massage HTML input in the HtmlContent class quite a bit. Are there specific tags that aren't working as you'd expect?
# June 25, 2004 12:11 PM

Loosely Coupled said:

# June 29, 2004 1:34 AM

Michael Hyatt said:

Okay, I confess, I'm not a programmer. If I register the DLL, will that do the trick or does the code have to be compiled into some sort of executable?
# July 4, 2004 4:40 AM

Donovan Lange said:

If you add it as a reference to your Visual Studio project, that should do the trick.

Hope this helps,

Donovan
# July 4, 2004 10:06 PM

Andrew May's WebLog said:

# July 27, 2004 2:31 PM

Omar Shahine's WebLog said:

# July 28, 2004 11:34 AM

Omar Shahine's WebLog said:

# July 28, 2004 11:35 AM

RoudyBob.NET said:

# July 31, 2004 9:03 PM

Andrew May's WebLog said:

# August 3, 2004 5:29 PM

Andrew May's WebLog said:

# August 4, 2004 12:35 PM

shahine.com/omar/ said:

# February 10, 2005 1:16 AM

Andrew May's WebLog said:

# February 14, 2005 1:56 PM

Andrew May's WebLog said:

# February 15, 2005 1:32 PM

Andrew May's WebLog said:

# February 16, 2005 6:47 PM

Andrew May's WebLog said:

# February 16, 2005 6:53 PM

Andrew May's WebLog said:

# February 17, 2005 12:38 PM

Andrew May's WebLog said:

# February 17, 2005 12:40 PM

Andrew May's WebLog said:

# February 17, 2005 12:57 PM

andrew connell said:

# March 31, 2005 8:50 AM

robrohr.org said:

Eye of OneNote Managed API, dash of providers, seive through Sharepoint event list schema, and what do you have?

Ummm...
# April 29, 2005 5:30 PM

robrohr.org said:

Eye of OneNote Managed API, dash of providers, seive through Sharepoint event list schema, and what do you have?

Ummm...
# April 29, 2005 5:23 PM

robrohr.org said:

Eye of OneNote Managed API, dash of providers, seive through Sharepoint event list schema, and what do you have?

Ummm...
# April 29, 2005 5:32 PM

robrohr.org said:

Last year at TechEd, I had the sweetest setup. My (at the time) new Gateway M275 TabletPC stuffed with every beta available (XP SP2 beta, Office 2003 beta, OneNote SP1 beta, InfoPath beta, etc.) was begging to be the envy of all conference attendees...
# May 9, 2005 11:09 AM

torsten's .NET blog said:

# September 2, 2005 3:11 PM

Derek said:

I really enjoyed the OneNote plugin to Outlook. I used both the Outlook and the IE plugin quite a bit. As of resent, in the last month or so, my OneNote icon in Outlook has disappeared. I have reinstalled, checked the .NET programming option for Outlook, etc.

Do you have any ideas what I need to do to resolve this problem?

Thanks,
Derek
# November 15, 2005 11:49 AM

Ray said:

I'm a new OneNote user, and so far I love it!  I have a couple of questions/comments:

- can it run from a USB drive (i.e. without needing to be installed on connected PC?)  It would be great for using at class for notes, then taking home.

- what type of encription is used for the password protection?

- can the new API be used to copy/paste from some other application?  And allow the other application to do the rendering of the inserted piece?
# February 9, 2006 3:08 PM

College Loan said:

Very good details and new. keep it posted.
# March 23, 2006 4:45 PM

OneNote Extensibility & More.. said:

Last year the OneNote marketing team started a contest to&amp;nbsp; see how developers and enthusiasts used...
# June 6, 2006 2:41 AM

robrohr.org said:

Last year at TechEd, I had the sweetest setup.  My (at the time) new Gateway M275 TabletPC stuffed with every beta available (XP SP2 beta, Office 2003 beta, OneNote SP1 beta, InfoPath beta, etc.) was begging to be the envy of all conference attendees..
# August 17, 2006 8:36 AM

clyx development blog said:

This library is an easy and fun way to integrate OneNote with .NET apps. We&amp;#39;ve used it for our freeware
# August 21, 2006 6:56 PM

werner - oder was ? said:

# September 7, 2006 12:11 PM

Nice Jobs said:

My name is Donovan Lange.  I'm a Software Design Engineer on Microsoft Office OneNote.

I do not agree. Go to http://www.auditjobs.info

# January 22, 2007 9:27 PM

unsportsmanlike Torquay said:

My name is Donovan Lange.  I'm a Software Design Engineer on Microsoft Office OneNote.

I do not agree. Go to http://www.autosjob.info/filiation_United%20Kingdom/hinny_England/unsportsmanlike_Torquay_1.html

# January 24, 2007 5:01 AM

acropolis Amsterdam said:

My name is Donovan Lange.  I'm a Software Design Engineer on Microsoft Office OneNote.

I do not agree. Go to http://www.dojobs.info/vena_Netherlands/regulation_Holland/acropolis_Amsterdam_1.html

# March 22, 2007 4:23 AM

cvaxp said:

http://www.forumup.us/?mforum=bookreader <a href= http://www.forumup.us/?mforum=bookreader >college text books online</a> [url=http://www.forumup.us/?mforum=bookreader]college text books online[/url]

# May 11, 2007 5:00 PM

Holly said:

I'm seeking a software that can add the context in clipboard to onenote by using hotkey,does it have be done by anyone?or i have to try to do it myself.

# May 17, 2007 11:05 PM

Look who's here! Be seeing you.,mlmsearch,mlmsearch said:

Look who's here!

Be seeing you.,Look who's here!

Be seeing you.,Look who's here!

Be seeing you.,Look who's here!

Be seeing you.

# June 14, 2007 1:39 PM

How are you doing on? Bye.,mlmbusiness,mlmbusiness said:

How are you doing on?

Bye.,How are you doing on?

Bye.,How are you doing on?

Bye.,How are you doing on?

Bye.

# June 15, 2007 5:09 PM

Tales from the SharpSide said:

RSSBandit Plugin - RSS2OneNote

# July 23, 2007 1:51 AM

.Net World said:

Woohoo!, I love using Onfolio but I&#39;m also starting to love using OneNote too (only wish I had a

# April 15, 2008 1:35 PM

sacchit.thakur@brainvisa.com said:

Error: Attempting to import invalid XML!

The error is coming while running the code on this page.

# August 26, 2008 7:54 AM

sacchit.thakur@brainvisa.com said:

I missed this line below

[3/22/06: Updated URLs to point to new site.] point here http://lange.officeisp.net/DataImport/

# August 26, 2008 8:11 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker