<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Andrew May's WebLog : OneNote</title><link>http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx</link><description>Tags: OneNote</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>OneNote: Importing Pages that Vanish</title><link>http://blogs.msdn.com/andrew_may/archive/2005/04/01/404781.aspx</link><pubDate>Fri, 01 Apr 2005 21:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:404781</guid><dc:creator>Andrew May</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/404781.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=404781</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=404781</wfw:comment><description>&lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Here's an interesting little "gotcha" that was found by &lt;/font&gt;&lt;a href="http://search.microsoft.com/search/results.aspx?qu=saul+candib&amp;amp;View=msdn&amp;amp;st=b&amp;amp;c=0&amp;amp;s=1&amp;amp;swc=0"&gt;&lt;font face="Verdana" size="2"&gt;Saul Candib&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;, the programmer-writer who is taking over documenting OneNote programming features, now that I've moved over to &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:mswterms w:st="on"&gt;SharePoint&lt;/st1:mswterms&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Using my article &lt;/font&gt;&lt;a href="http://www.msdn.microsoft.com/office/understanding/onenote/default.aspx?pull=/library/en-us/odc_on2003_ta/html/odc_on_importapi.asp"&gt;&lt;font face="Verdana" size="2"&gt;Importing Content into OneNote 2003 SP1&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; as a guide, Saul wrote some code that imported content into OneNote. The code seemed to work fine: OneNote would create the page the user specified, and import the specified content no problem.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Except, once you closed OneNote, when you opened it again the page and all its contents were gone.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Turns out Saul wasn't specifying the '.one' file extension for the page. So the import routine worked perfectly; OneNote created the page and imported the content. You could even go in and add or edit the content on the new page, whatever you wanted. OneNote actually was saving the page in the My Notebooks folder, but without an extension. So the next time you launched OneNote, it saw the imported page as an unknown file and so didn't load it.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;All of this was news to me. In my XML examples in the article, I used the .one file extension. For example:&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font face="Courier New" size="2"&gt;&amp;lt;PlaceObjects pagePath="&lt;st1:mswterms w:st="on"&gt;MSN&lt;/st1:mswterms&gt; Instant Messenger\Conversations.one" pageGuid="{8FDD3C41-5BB5-4595-B019-7E7E9BC9D38E}"&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;But I never specifically called out that this was a requirement; to be honest, I don’t remember if I ever realized it &lt;i style="mso-bidi-font-style: normal"&gt;was&lt;/i&gt; a requirement. I certainly never experimented with what happened if I didn't specify the file extension.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;What's worse, in my example in the article, I wrote a really basic application that let the user enter the name of the page they wanted to create. But I didn't write any code that checked the specified page name to make sure it contained the file extension, or add the extension if the page name didn't. Shame on me.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=404781" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote XML Schema Map Notation, Take Two</title><link>http://blogs.msdn.com/andrew_may/archive/2005/02/24/379844.aspx</link><pubDate>Thu, 24 Feb 2005 20:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:379844</guid><dc:creator>Andrew May</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/379844.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=379844</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=379844</wfw:comment><description>&lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;So, I was so annoyed when I realized I had broken one of the basic rules of information design with my diagram of the OneNote 2003 SP1 SimpleImport schema, I had to take a few minutes and see if I could fix it. As I mentioned in &lt;/font&gt;&lt;A href="http://blogs.msdn.com/andrew_may/admin/r"&gt;&lt;font face="Verdana" size="2"&gt;my last entry&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;, my diagram uses indenting and boxes to show the element hierarchy in the OneNote schema. But, because I was illustrating the same information (the element hierarchy) two different ways (indenting and boxing), the diagram contained redundant information, and was more complicated than it needed to be.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;And I hated those damn boxes anyway. Chopping a diagram up into a grid like that only ends up distracting from the information. I knew it at the time, but I was on a deadline and couldn't come up with a better solution, so…&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Below is my latest attempt. The grid lines are gone; element hierarchy is denoted now solely by the indenting of the element names. By formatting the information inside each element (such as data type and attributes) gray, I think I've been able to keep the element names prominent enough I don’t need boxes to denote where one element ends and another starts.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;One thing that I still see as problematic is the indenting of the element information, like the data type and attributes. In this small example, I was able to keep all that information at the same left-alignment for all the elements, which again keeps that information from distracting from the element names. But, had the schema hierarchy included a few more levels, I would've had to move the element information even further over, perhaps to the point where it was so far removed from the element names in the top-level elements that it would seem disconnected.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.officezealot.com/john/ON_Schema%20Take%20Two_1.gif" /&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;All in all, I think this diagram is quite a bit more successful than the one that currently appears in the article. Looks like it's time to file a bug and get that image swapped out…&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=379844" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote: An In-Depth Look at the OneNoteImporter Managed Assembly (Part 5 of 5)</title><link>http://blogs.msdn.com/andrew_may/archive/2005/02/17/375435.aspx</link><pubDate>Thu, 17 Feb 2005 17:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:375435</guid><dc:creator>Andrew May</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/375435.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=375435</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=375435</wfw:comment><description>&lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;In this series of entries, we're taking an in-depth at the &lt;/font&gt;&lt;A href="http://blogs.msdn.com/dolange/archive/2004/06/17/158976.aspx"&gt;&lt;font face="Verdana" size="2"&gt;OneNoteImporter&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; manage class, which provides an object model interface for the programmability functionality added in OneNote 2003 SP 1.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/14/372450.aspx"&gt;&lt;font face="Verdana" size="2"&gt;Read part one here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/15/373183.aspx"&gt;&lt;font face="Verdana" size="2"&gt;Read part two here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/16/374867.aspx"&gt;&lt;font face="Verdana" size="2"&gt;Read part three here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/17/375412.aspx"&gt;&lt;font face="Verdana" size="2"&gt;Read part four here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;h5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;font face="Verdana" size="4"&gt;Object Model Maps&lt;/font&gt;&lt;/h5&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The following figures diagram the OneNoteImporter assembly object model, including abstract classes and inheritance. The diagrams mainly document how the objects in the assembly relate to each other. In most cases, when a member takes an object as a parameter, or returns an object, that object is included on the diagram. Value types, such as string or integers, are for the most part not displayed.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;For the sake of clarity, the following object information, pertaining to methods that most of the classes have, has been left off the diagrams:&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;Clone&lt;/strong&gt;&lt;/span&gt; method returns the type of object from which you call it.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;Equals&lt;/strong&gt;&lt;/span&gt; method takes a &lt;span class="Bold"&gt;&lt;strong&gt;System.Object&lt;/strong&gt;&lt;/span&gt; as a parameter.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;GetHashCode&lt;/strong&gt;&lt;/span&gt; method returns a &lt;span class="Bold"&gt;&lt;strong&gt;System.Int32&lt;/strong&gt;&lt;/span&gt; object suitable for use in hashing algorithms and data structures like a hash table.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Inheritance from &lt;span class="Bold"&gt;&lt;strong&gt;System.Object&lt;/strong&gt;&lt;/span&gt; is not shown.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.officezealot.com/john/ODC_ON_ImportClasses_InDepth_2.gif" /&gt;&lt;/p&gt; &lt;p class="Label" style="MARGIN: 3pt 0in"&gt;&lt;strong&gt;&lt;font face="Verdana" size="2"&gt;Figure 2. The Application Object (and Legend)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="Label" style="MARGIN: 3pt 0in"&gt;&lt;strong&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="Figure" style="MARGIN: 3pt 0in 9pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;img src="http://www.officezealot.com/john/ODC_ON_ImportClasses_InDepth_3.gif" /&gt;&lt;/p&gt; &lt;p class="Label" style="MARGIN: 3pt 0in"&gt;&lt;strong&gt;&lt;font face="Verdana" size="2"&gt;Figure 3. The ImportNode Abstract Class, and Page Class&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.officezealot.com/john/ODC_ON_ImportClasses_InDepth_4a.gif" /&gt;&lt;img src="http://www.officezealot.com/john/ODC_ON_ImportClasses_InDepth_4b.gif" /&gt;&lt;/p&gt; &lt;p class="Label" style="MARGIN: 3pt 0in"&gt;&lt;strong&gt;&lt;font face="Verdana" size="2"&gt;Figure 4. The PageObject Abstract Class, and Derived Classes&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.officezealot.com/john/ODC_ON_ImportClasses_InDepth_5a.gif" /&gt;&lt;img src="http://www.officezealot.com/john/ODC_ON_ImportClasses_InDepth_5b.gif" /&gt;&lt;/p&gt; &lt;p class="Label" style="MARGIN: 3pt 0in"&gt;&lt;strong&gt;&lt;font face="Verdana" size="2"&gt;Figure 5. The OutlineContent Abstract Class, and Derived Classes&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.officezealot.com/john/ODC_ON_ImportClasses_InDepth_6.gif" /&gt;&lt;/p&gt; &lt;p class="Label" style="MARGIN: 3pt 0in"&gt;&lt;strong&gt;&lt;font face="Verdana" size="2"&gt;Figure 6. The Data Abstract Class, and Derived Classes&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;h5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;font face="Verdana" size="4"&gt;Conclusion&lt;/font&gt;&lt;/h5&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The OneNoteImporter managed assembly provides a convenient and multi-functional ‘wrapper’ for working with the SimpleImporter and command line functionality in OneNote 2003 SP1. Moreover, using the provided source files for the assembly, a developer can customize and extend the classes as required for his particular application.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=375435" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote: An In-Depth Look at the OneNoteImporter Managed Assembly (Part 4 of 5)</title><link>http://blogs.msdn.com/andrew_may/archive/2005/02/17/375412.aspx</link><pubDate>Thu, 17 Feb 2005 17:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:375412</guid><dc:creator>Andrew May</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/375412.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=375412</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=375412</wfw:comment><description>&lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;In this series of entries, we're taking an in-depth at the &lt;/font&gt;&lt;A href="http://blogs.msdn.com/dolange/archive/2004/06/17/158976.aspx"&gt;&lt;font face="Verdana" size="2"&gt;OneNoteImporter&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; manage class, which provides an object model interface for the programmability functionality added in OneNote 2003 SP 1.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/14/372450.aspx"&gt;&lt;font face="Verdana" size="2"&gt;Read part one here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/15/373183.aspx"&gt;&lt;font face="Verdana" size="2"&gt;Read part two here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/16/374867.aspx"&gt;&lt;font face="Verdana" size="2"&gt;Read part three here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Figure 1 diagrams the internal method calls of the &lt;b style="mso-bidi-font-weight: normal"&gt;Commit&lt;/b&gt; method. It shows the &lt;span class="Bold"&gt;&lt;strong&gt;OneNoteImporter&lt;/strong&gt;&lt;/span&gt; classes and methods called, and the Import XML elements generated at each step. The various calls to &lt;span class="Bold"&gt;&lt;strong&gt;System.Xml&lt;/strong&gt;&lt;/span&gt; methods are not diagrammed.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;img src="http://www.officezealot.com/john/ODC_ON_ImportClasses_InDepth_1.gif" /&gt;&lt;/p&gt; &lt;p class="Label" style="MARGIN: 3pt 0in"&gt;&lt;strong&gt;&lt;font face="Verdana" size="2"&gt;Figure 1. The Page.Commit Method, and XML Elements Generated&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;font face="Verdana" size="2"&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;In our final entry, we'll look at some object model maps that detail how the OneNoteImporter class is structured.&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/17/375435.aspx"&gt;Read part five here&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=375412" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote: An In-Depth Look at the OneNoteImporter Managed Assembly (Part 3 of 5)</title><link>http://blogs.msdn.com/andrew_may/archive/2005/02/16/374867.aspx</link><pubDate>Wed, 16 Feb 2005 23:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:374867</guid><dc:creator>Andrew May</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/374867.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=374867</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=374867</wfw:comment><description>&lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;In this series of entries, we're taking an in-depth at the &lt;/font&gt;&lt;A href="http://blogs.msdn.com/dolange/archive/2004/06/17/158976.aspx"&gt;&lt;font face="Verdana" size="2"&gt;OneNoteImporter&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; manage class, which provides an object model interface for the programmability functionality added in OneNote 2003 SP 1.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/14/372450.aspx"&gt;&lt;font face="Verdana" size="2"&gt;Read part one here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/15/373183.aspx"&gt;&lt;font face="Verdana" size="2"&gt;Read part two here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;h5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;font face="Verdana" size="4"&gt;Importing Objects into OneNote&lt;/font&gt;&lt;/h5&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The actual creation of the XML import document, and importing the page contents, takes place when you call the &lt;span class="Bold"&gt;&lt;strong&gt;Page.Commit&lt;/strong&gt;&lt;/span&gt; method. This method, in turn, invokes a number of methods in other OneNoteImporter objects. Because of this method’s importance and complexity, it’s worth examining how the method functions.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;First, the code checks to see if the page has changed in any way from the last time it was imported. It does this by determining if the &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt; object’s &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property is set to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt;. If it is, it calls the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImporter.Import&lt;/strong&gt;&lt;/span&gt; method.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The code calls the &lt;span class="Bold"&gt;&lt;strong&gt;Page.ToString&lt;/strong&gt;&lt;/span&gt; method to generate the XML string it passes to the Import method. The &lt;span class="Bold"&gt;&lt;strong&gt;ToString&lt;/strong&gt;&lt;/span&gt; method in turn calls the &lt;span class="Bold"&gt;&lt;strong&gt;Page.SerializeToXml&lt;/strong&gt;&lt;/span&gt; method.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;This begins a series of recursive calls to the &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXml&lt;/strong&gt;&lt;/span&gt; methods of the various objects. Each object’s &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXml&lt;/strong&gt;&lt;/span&gt; method includes instructions to call the &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXml&lt;/strong&gt;&lt;/span&gt; method of any child objects, and append the resulting XML to the parent element. This in turn invokes the &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXml&lt;/strong&gt;&lt;/span&gt; method of any child objects the original child object might have, and so on, until the entire page structure has been serialized to xml in a single xml document.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;Page.SerializeToXml&lt;/strong&gt;&lt;/span&gt; begins by creating a new &lt;span class="Bold"&gt;&lt;strong&gt;XmlDocument&lt;/strong&gt;&lt;/span&gt; object, and generating &amp;lt;Import&amp;gt; and &amp;lt;EnsurePage&amp;gt; elements and adding them to the document. Page object property values are used to set the various attributes of the &amp;lt;EnsurePage&amp;gt; element.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Note that the &lt;b style="mso-bidi-font-weight: normal"&gt;Commit&lt;/b&gt; method generates import XML with both &amp;lt;EnsurePage&amp;gt; and &amp;lt;PlaceObjects&amp;gt; elements for that page. Specifying an &amp;lt;EnsurePage&amp;gt; element for a page guarantees that the page exists before OneNote attempts to import objects onto it. So if your application includes a scenario where you only want to import objects onto a page if the page &lt;i style="mso-bidi-font-style: normal"&gt;already&lt;/i&gt; exists, you’ll need to modify this method, or use another means.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The code then generates a &amp;lt;PlaceObjects&amp;gt; element. For each of the &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt; object’s children whose &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property is set to &lt;b style="mso-bidi-font-weight: normal"&gt;True&lt;/b&gt;, the code calls the &lt;span class="Bold"&gt;&lt;strong&gt;PageObject.SerializeToXml&lt;/strong&gt;&lt;/span&gt; method.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;If the page object’s &lt;span class="Bold"&gt;&lt;strong&gt;DeletePending&lt;/strong&gt;&lt;/span&gt; property is set to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt;, the &lt;span class="Bold"&gt;&lt;strong&gt;PageObject.SerializeToXml&lt;/strong&gt;&lt;/span&gt; method generates a &amp;lt;Delete&amp;gt; element. If not, the method does three things:&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Generates a &amp;lt;Position&amp;gt; element, whose attributes are set according to &lt;span class="Bold"&gt;&lt;strong&gt;Position&lt;/strong&gt;&lt;/span&gt; object property values.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Calls the &lt;span class="Bold"&gt;&lt;strong&gt;SerializeObjectToXml&lt;/strong&gt;&lt;/span&gt; method for the specific PageObject-derived class involved, i.e., &lt;span class="Bold"&gt;&lt;strong&gt;ImageObject&lt;/strong&gt;&lt;/span&gt;, &lt;span class="Bold"&gt;&lt;strong&gt;InkObject&lt;/strong&gt;&lt;/span&gt;, or &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Calls the &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXml&lt;/strong&gt;&lt;/span&gt; method for the specific &lt;b style="mso-bidi-font-weight: normal"&gt;OutlineContent&lt;/b&gt;-derived class involved, i.e., &lt;span class="Bold"&gt;&lt;strong&gt;HtmlContent&lt;/strong&gt;&lt;/span&gt;, &lt;span class="Bold"&gt;&lt;strong&gt;InkContent&lt;/strong&gt;&lt;/span&gt;, or &lt;span class="Bold"&gt;&lt;strong&gt;ImageContent&lt;/strong&gt;&lt;/span&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in; TEXT-INDENT: 0in; mso-list: none; tab-stops: .5in"&gt;&lt;font face="Verdana" size="2"&gt;Executing the &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXml&lt;/strong&gt;&lt;/span&gt; method for each of these content types includes a call to the &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXml&lt;/strong&gt;&lt;/span&gt; method for the &lt;b style="mso-bidi-font-weight: normal"&gt;Data&lt;/b&gt;-derived object they contain: &lt;span class="Bold"&gt;&lt;strong&gt;BinaryData&lt;/strong&gt;&lt;/span&gt;, &lt;span class="Bold"&gt;&lt;strong&gt;FileData&lt;/strong&gt;&lt;/span&gt;, or &lt;span class="Bold"&gt;&lt;strong&gt;StringData&lt;/strong&gt;&lt;/span&gt;. In this way, the entire page structure is serialized to xml in a single xml document.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;Note that the &lt;span class="Bold"&gt;&lt;strong&gt;HtmlContent.SerializeToXml&lt;/strong&gt;&lt;/span&gt; method includes a call to another internal method of that same object, called &lt;span class="Bold"&gt;&lt;strong&gt;CleanHtml&lt;/strong&gt;&lt;/span&gt;. The &lt;span class="Bold"&gt;&lt;strong&gt;CleanHtml&lt;/strong&gt;&lt;/span&gt; method reads through the html string or file data and makes sure the HTML is formatted in a way that OneNote accepts. It identifies and replaces problematic formatting with characters which OneNote can process. For example, the &lt;span class="Bold"&gt;&lt;strong&gt;CleanHtml&lt;/strong&gt;&lt;/span&gt; method wraps the HTML string with the appropriate &lt;span style="COLOR: windowtext"&gt;&amp;lt;html&amp;gt; and &amp;lt;body&amp;gt; tags if the HTML lacks them.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The serialization of the page nodes is now complete. If the Page object had no children, the &amp;lt;PlaceObjects&amp;gt; element remains empty. In such a case, the &lt;span class="Bold"&gt;&lt;strong&gt;Page.SerializeToXml&lt;/strong&gt;&lt;/span&gt; method does not append it to the &amp;lt;Import&amp;gt; element.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Finally, the &lt;span class="Bold"&gt;&lt;strong&gt;Page.SerializeToXml&lt;/strong&gt;&lt;/span&gt; method determines the appropriate namespace designation and adds it to the &amp;lt;Import&amp;gt; element.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;ToString&lt;/strong&gt;&lt;/span&gt; method then takes the &lt;span class="Bold"&gt;&lt;strong&gt;XmlDocument&lt;/strong&gt;&lt;/span&gt; object, saves it as a text stream, converts it to a string, and passes it back to the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImporter.Import&lt;/strong&gt;&lt;/span&gt; method. This &lt;b style="mso-bidi-font-weight: normal"&gt;Import&lt;/b&gt; method uses the XML string to import the specified content into OneNote.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Now that the content has been imported into OneNote, the &lt;span class="Bold"&gt;&lt;strong&gt;Commit&lt;/strong&gt;&lt;/span&gt; method performs some vital housekeeping. Using the &lt;span class="Bold"&gt;&lt;strong&gt;RemoveChild&lt;/strong&gt;&lt;/span&gt; method, it removes any of the &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt; object’s children who have their &lt;span class="Bold"&gt;&lt;strong&gt;DeletePending&lt;/strong&gt;&lt;/span&gt; property set to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt;. It then sets the private &lt;b style="mso-bidi-font-weight: normal"&gt;committed&lt;/b&gt; field to True, thereby making the &lt;span class="Bold"&gt;&lt;strong&gt;Date&lt;/strong&gt;&lt;/span&gt;, &lt;span class="Bold"&gt;&lt;strong&gt;PreviousPage&lt;/strong&gt;&lt;/span&gt;, &lt;span class="Bold"&gt;&lt;strong&gt;RTL&lt;/strong&gt;&lt;/span&gt;, and &lt;span class="Bold"&gt;&lt;strong&gt;Title &lt;/strong&gt;&lt;/span&gt;properties&lt;span class="Bold"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;read-only. You cannot change these attributes once you import a page into OneNote.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Lastly, it sets the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property of the &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt; to &lt;span class="Bold"&gt;&lt;strong&gt;False&lt;/strong&gt;&lt;/span&gt;. This it turn sets the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; properties of all the &lt;b style="mso-bidi-font-weight: normal"&gt;Page&lt;/b&gt; object’s remaining children to &lt;b style="mso-bidi-font-weight: normal"&gt;False&lt;/b&gt; as well.&lt;/font&gt;&lt;/p&gt;&lt;font face="Verdana" size="2"&gt;&lt;font face="Verdana" size="2"&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;In part four, we'll examine the internal method calls of the &lt;b style="mso-bidi-font-weight: normal"&gt;Commit&lt;/b&gt; method.&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/17/375412.aspx"&gt;Read part four here&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=374867" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote: An In-Depth Look at the OneNoteImporter Managed Assembly (Part 2 of 5)</title><link>http://blogs.msdn.com/andrew_may/archive/2005/02/15/373183.aspx</link><pubDate>Tue, 15 Feb 2005 18:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:373183</guid><dc:creator>Andrew May</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/373183.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=373183</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=373183</wfw:comment><description>&lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;In part one, we started to take an in-depth at the &lt;/font&gt;&lt;A href="http://blogs.msdn.com/dolange/archive/2004/06/17/158976.aspx"&gt;&lt;font face="Verdana" size="2"&gt;OneNoteImporter&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; manage class, which provides an object model interface for the programmability functionality added in OneNote 2003 SP 1.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/14/372450.aspx"&gt;&lt;font face="Verdana" size="2"&gt;Read part one here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;h5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;font face="Verdana" size="4"&gt;Creating Objects&lt;/font&gt;&lt;/h5&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Creating the page and the object you want to import onto it is relatively straight-forward. The &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt;, &lt;span class="Bold"&gt;&lt;strong&gt;PageObject&lt;/strong&gt;&lt;/span&gt;-derived sub-classes, and &lt;span class="Bold"&gt;&lt;strong&gt;OutlineContent&lt;/strong&gt;&lt;/span&gt;-derived sub-classes all have one or more public constructors with which you create new instances. We should, however, briefly touch on a few &lt;span style="COLOR: windowtext"&gt;issues&lt;/span&gt; to keep in mind.&lt;/font&gt;&lt;/p&gt; &lt;h6&gt;&lt;font face="Verdana" size="2"&gt;Identifying Objects&lt;/font&gt;&lt;/h6&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Both the &lt;span class="Bold"&gt;&lt;strong&gt;Page &lt;/strong&gt;&lt;/span&gt;and &lt;span class="Bold"&gt;&lt;strong&gt;PageObject&lt;/strong&gt;&lt;/span&gt;-derived sub-classes have an internal &lt;b style="mso-bidi-font-weight: normal"&gt;Id&lt;/b&gt; property, which gets or sets an &lt;span class="Bold"&gt;&lt;strong&gt;ObjectId &lt;/strong&gt;&lt;/span&gt;object. The &lt;span class="Bold"&gt;&lt;strong&gt;ObjectId &lt;/strong&gt;&lt;/span&gt;represents the globally unique identifier (GUID) OneNote requires to identify each page and object imported. The data in an &lt;span class="Bold"&gt;&lt;strong&gt;ObjectId &lt;/strong&gt;&lt;/span&gt;consists of a private field representing the containing object’s identifier. The &lt;span class="Bold"&gt;&lt;strong&gt;ObjectId &lt;/strong&gt;&lt;/span&gt;object is generated when the page or object is constructed.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;ObjectId &lt;/strong&gt;&lt;/span&gt;object cannot be accessed from outside the assembly. The OneNoteImporter assembly generates and maintains the GUIDs for the user. If you are programming for a scenario that requires you to have access to the GUIDs, there are two approaches to consider:&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Override the class, and make the GUID properties publicly accessible.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Serialize and persist the Page object between sessions, and then deserialize it as necessary.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Note that the &lt;span class="Bold"&gt;&lt;strong&gt;ObjectId&lt;/strong&gt;&lt;/span&gt; class stores the object GUID internally as a &lt;span class="Bold"&gt;&lt;strong&gt;System.Guid&lt;/strong&gt;&lt;/span&gt; data type, which does not store the GUID in registry format, that is, surrounded by curly braces ({}). OneNote only accepts GUIDs in registry format. Therefore, the &lt;span class="Bold"&gt;&lt;strong&gt;ObjectId.ToString&lt;/strong&gt;&lt;/span&gt; method has been overridden so that it wraps the &lt;b style="mso-bidi-font-weight: normal"&gt;guid&lt;/b&gt; value in curly braces before returning the string.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Similarly, if you use the &lt;b style="mso-bidi-font-weight: normal"&gt;ObjectId&lt;/b&gt;(&lt;i style="mso-bidi-font-style: normal"&gt;string&lt;/i&gt;) overloaded constructor, the constructor code strips off curly braces, if present. As they might be, if you were passing a serialized &lt;span class="Bold"&gt;&lt;strong&gt;ObjectId&lt;/strong&gt;&lt;/span&gt; as an argument.&lt;/font&gt;&lt;/p&gt; &lt;h6&gt;&lt;font face="Verdana" size="2"&gt;Committing Objects for Importing&lt;/font&gt;&lt;/h6&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property determines whether or not an import node is included in the XML passed to the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImporter.Import&lt;/strong&gt;&lt;/span&gt; method. Objects with this property set to &lt;b style="mso-bidi-font-weight: normal"&gt;True&lt;/b&gt; represent one of the following: &lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;an object that hasn’t been imported into OneNote &lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;an object which as been changed since the last time it was imported; this includes objects marked for deletion from OneNote&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;an object that contains a child object that is either of the two cases above&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Only objects whose &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property is set to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt; are serialized and included in the import XML string. By default, whenever an object is constructed from an &lt;span class="Bold"&gt;&lt;strong&gt;ImportNode&lt;/strong&gt;&lt;/span&gt;-derived class, this property is set to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt;. Let’s examine how this property is used, and when they value is changed.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Calling the &lt;span class="Bold"&gt;&lt;strong&gt;Page.Commit&lt;/strong&gt;&lt;/span&gt; method imports the page and its contents into OneNote. Once you import a page, the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property is set to &lt;span class="Bold"&gt;&lt;strong&gt;False&lt;/strong&gt;&lt;/span&gt; for that &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt; object and all the objects contained on it. If you immediately called the &lt;span class="Bold"&gt;&lt;strong&gt;Commit&lt;/strong&gt;&lt;/span&gt; method again, neither the page nor any of the objects on it would be included in the XML for the next import.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;However, when you make a change to an object, such as changing a property value, the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property gets set back to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt;. Not only that, but the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property of any parent object gets set to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt; as well. This happens because of the way the import XML is structured. If you want to re-import a specific object, you must also include information about all the objects that contain it, such as the page it appears on. Setting the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt; for all the parent objects ensure all the necessary information is included in the import XML string.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Here’s how it actually happens in the code:&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;You cannot access the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property from outside the OneNoteImporter class assembly, but if you change any public object properties, the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property is set to &lt;b style="mso-bidi-font-weight: normal"&gt;True&lt;/b&gt;, so that those object changes are imported into OneNote the next time you call the &lt;span class="Bold"&gt;&lt;strong&gt;Page.Commit&lt;/strong&gt;&lt;/span&gt; method. This includes setting the &lt;span class="Bold"&gt;&lt;strong&gt;DeletePending&lt;/strong&gt;&lt;/span&gt; property of an object to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;In addition, the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property code also sets the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property of the parent object, if there is one, to &lt;b style="mso-bidi-font-weight: normal"&gt;True&lt;/b&gt;. Which in turns calls the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property code again, in case that parent object has a parent, and so on up the import node structure to the &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt; object.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Conversely, when the Commit method sets a Page object’s &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property to &lt;span class="Bold"&gt;&lt;strong&gt;False&lt;/strong&gt;&lt;/span&gt;, the property code sets the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property of any children to &lt;span class="Bold"&gt;&lt;strong&gt;False&lt;/strong&gt;&lt;/span&gt; as well, which in turn calls the method again, in case any of those objects have children, and so on.&lt;/font&gt;&lt;/p&gt; &lt;h5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;font face="Verdana" size="4"&gt;Adding Objects to Pages and Outlines&lt;/font&gt;&lt;/h5&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;You can add content directly to a page, and to an outline on a page. The public &lt;span class="Bold"&gt;&lt;strong&gt;Page.AddObject&lt;/strong&gt;&lt;/span&gt; and &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject.AddContent&lt;/strong&gt;&lt;/span&gt; methods both call the internal &lt;span class="Bold"&gt;&lt;strong&gt;ImportNode.AddChild&lt;/strong&gt;&lt;/span&gt; method, which adds the child object to a private &lt;span class="Bold"&gt;&lt;strong&gt;ArrayList&lt;/strong&gt;&lt;/span&gt; object. A convenience constructor enables you to name the object when you add it, if you want.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;OutlineContent&lt;/strong&gt;&lt;/span&gt; objects are displayed in the order in which they are added to the &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt; object.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;To import text into a OneNote page, you add an &lt;span class="Bold"&gt;&lt;strong&gt;HtmlContent&lt;/strong&gt;&lt;/span&gt; object to an &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt;, and then add the &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt; to the desired Page object.&lt;/font&gt;&lt;/p&gt; &lt;h6&gt;&lt;font face="Verdana" size="2"&gt;Deleting Objects From OneNote&lt;/font&gt;&lt;/h6&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;In the &lt;span class="Bold"&gt;&lt;strong&gt;OneNoteImporter&lt;/strong&gt;&lt;/span&gt; assembly, there are two levels of deleting objects:&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Marking an object for deletion the next time the page is imported into OneNote&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Removing an object from the &lt;span class="Bold"&gt;&lt;strong&gt;OneNoteImporter&lt;/strong&gt;&lt;/span&gt; object structure; for example, as removing an &lt;span class="Bold"&gt;&lt;strong&gt;ImageContent&lt;/strong&gt;&lt;/span&gt; object from an &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt; object&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;To delete an object from a OneNote page, use the &lt;span class="Bold"&gt;&lt;strong&gt;Page.DeleteObject&lt;/strong&gt;&lt;/span&gt; method. This method does not directly remove the object from the &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt; object’s private &lt;span class="Bold"&gt;&lt;strong&gt;children&lt;/strong&gt;&lt;/span&gt; array. Rather, it sets the &lt;span class="Bold"&gt;&lt;strong&gt;DeletePending&lt;/strong&gt;&lt;/span&gt; property of the specified object to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt;. Therefore, when you execute the &lt;span class="Bold"&gt;&lt;strong&gt;Page.Commit&lt;/strong&gt;&lt;/span&gt; method, the object gets deleted from the page in OneNote. Only then is the &lt;span class="Bold"&gt;&lt;strong&gt;ImportNode.RemoveChild&lt;/strong&gt;&lt;/span&gt; method called. It is this internal method that removes the object from the &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt; object’s array, using the &lt;span class="Bold"&gt;&lt;strong&gt;ArrayList.Remove&lt;/strong&gt;&lt;/span&gt; method. The &lt;span class="Bold"&gt;&lt;strong&gt;RemoveChild&lt;/strong&gt;&lt;/span&gt; method also sets the &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt; object’s &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property to &lt;b style="mso-bidi-font-weight: normal"&gt;True&lt;/b&gt;; however, the &lt;span class="Bold"&gt;&lt;strong&gt;Commit&lt;/strong&gt;&lt;/span&gt; method then sets it to &lt;span class="Bold"&gt;&lt;strong&gt;False&lt;/strong&gt;&lt;/span&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="AlertText" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/span&gt; You can even call the &lt;span class="Bold"&gt;&lt;strong&gt;DeleteObject&lt;/strong&gt;&lt;/span&gt; method for objects that have not been imported into OneNote. While this means the object is serialized and included in the XML string passed to the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImporter.Import&lt;/strong&gt;&lt;/span&gt; method, no error results. OneNote ignores XML elements directing it to delete objects not present on the specific page. This is by design, since the OneNote user may have manually deleted the object themselves.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Conversely, to remove an object from an outline, use the &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject.RemoveContent&lt;/strong&gt;&lt;/span&gt; method, which directly calls the &lt;span class="Bold"&gt;&lt;strong&gt;ImportNode.RemoveChild&lt;/strong&gt;&lt;/span&gt; method. So the object is removed from the &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt; object’s &lt;span class="Bold"&gt;&lt;strong&gt;children&lt;/strong&gt;&lt;/span&gt; array at the time the &lt;span class="Bold"&gt;&lt;strong&gt;RemoveContent&lt;/strong&gt;&lt;/span&gt; method executes. The &lt;span class="Bold"&gt;&lt;strong&gt;RemoveChild&lt;/strong&gt;&lt;/span&gt; content also sets the &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property of the &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt; object to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt;, so that the entire updated outline (minus the removed object) is imported into OneNote again the next time the &lt;span class="Bold"&gt;&lt;strong&gt;Page.Commit&lt;/strong&gt;&lt;/span&gt; method executes.&lt;/font&gt;&lt;/p&gt; &lt;h6&gt;&lt;font face="Verdana" size="2"&gt;Iterating through an import node’s children&lt;/font&gt;&lt;/h6&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Both the &lt;span class="Bold"&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/span&gt; and &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt; objects implement the &lt;span class="Bold"&gt;&lt;strong&gt;IEnumerable&lt;/strong&gt;&lt;/span&gt; interface. Their respective public &lt;span class="Bold"&gt;&lt;strong&gt;GetEnumerator&lt;/strong&gt;&lt;/span&gt; methods provide the ability to iterate through their private &lt;span class="Bold"&gt;&lt;strong&gt;children&lt;/strong&gt;&lt;/span&gt; array.&lt;/font&gt;&lt;/p&gt;&lt;font face="Verdana" size="2"&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;In part three, we'll get to the whole point of the OneNoteImporter class: importing objects into OneNote.&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/16/374867.aspx"&gt;Read part three here&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=373183" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote: An In-Depth Look at the OneNoteImporter Managed Assembly (Part 1 of 5)</title><link>http://blogs.msdn.com/andrew_may/archive/2005/02/14/372450.aspx</link><pubDate>Mon, 14 Feb 2005 18:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:372450</guid><dc:creator>Andrew May</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/372450.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=372450</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=372450</wfw:comment><description>&lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;A while back I wrote a series of entries dealing with how you can use Donovan Lange's OneNoteImporter manage class to make importing content into OneNote 2003 SP1 even easier. To recap: Donovan's OneNoteImporter managed class assembly provides an object model interface for the programmability functionality added in OneNote 2003 SP 1. Both the &lt;/font&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=87c661e3-178d-46f0-979e-0fdd96327928&amp;amp;displaylang=en"&gt;&lt;font face="Verdana" size="2"&gt;Send to OneNote from Outlook&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; and &lt;/font&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a9872a17-2d0c-47f0-9b4d-026e94a8ef1c&amp;amp;displaylang=en"&gt;&lt;font face="Verdana" size="2"&gt;Send to OneNote from Internet Explorer&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; PowerToy add-ins actually use the OneNoteImporter class in their source code.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;You can download the OneNoteImporter class source code from Donovan's blog &lt;/font&gt;&lt;A href="http://blogs.msdn.com/dolange/archive/2004/06/17/158976.aspx"&gt;&lt;font face="Verdana" size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;You can read my initial series of blog entries about the OneNoteImporter class here: &lt;/font&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2004/07/27/198813.aspx"&gt;&lt;font face="Verdana" size="2"&gt;part one&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;, and &lt;/font&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2004/07/28/199832.aspx"&gt;&lt;font face="Verdana" size="2"&gt;part two&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;For the next week or so I'll be running a series of entries that examine the OneNoteImporter class in more detail, and really get 'under the hood' on how the class is structured and functions.&lt;/font&gt;&lt;/p&gt; &lt;h5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;font face="Verdana" size="4"&gt;Introduction&lt;/font&gt;&lt;/h5&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The OneNoteImporter managed class assembly provides an object model interface for the programmability functionality added in &lt;/font&gt;&lt;a href="http://www.microsoft.com/office/onenote/prodinfo/sp1/default.mspx"&gt;&lt;font face="Verdana" size="2"&gt;OneNote 2003 Service Pack (SP) 1&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The classes in this assembly enable you to:&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Import content into OneNote SP1 using the SimpleImport.Import method without having to explicitly author the XML string this method takes as a parameter. The OneNote managed assembly does this for you.&lt;/font&gt;&lt;/p&gt; &lt;p class="TextIndented" style="MARGIN: 3pt 0.25in"&gt;&lt;font face="Verdana" size="2"&gt;You do not need to be familiar with the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImporter&lt;/strong&gt;&lt;/span&gt; class, or the XML schema used by its &lt;span class="Bold"&gt;&lt;strong&gt;Import&lt;/strong&gt;&lt;/span&gt; method, to use the OneNoteImporter managed assembly. However, for more information about the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImporter&lt;/strong&gt;&lt;/span&gt; class and its operation, see &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/office/default.aspx?pull=/library/en-us/odc_on2003_ta/html/odc_ON_ImportAPI.asp"&gt;&lt;font face="Verdana" size="2"&gt;Importing Content into Microsoft Office OneNote 2003 SP1&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Navigate to a specific page in OneNote using the SimpleImport.NavigateTo method.&lt;/font&gt;&lt;/p&gt; &lt;p class="TextIndented" style="MARGIN: 3pt 0.25in"&gt;&lt;font face="Verdana" size="2"&gt;This is also covered in the article referenced above.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Use class methods to invoke some of the more popular command line switches you can use to customize how the OneNote application launches.&lt;/font&gt;&lt;/p&gt; &lt;p class="TextIndented" style="MARGIN: 3pt 0.25in"&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;For more information on customizing OneNote 2003 using command line switches, see &lt;span style="mso-bidi-font-size: 13.0pt"&gt;&lt;a href="http://www.msdn.microsoft.com/office/default.aspx?pull=/library/en-us/odc_on2003_ta/html/odc_ON_CLSwitches.asp"&gt;Customizing OneNote 2003 SP 1 Using New Command Line Switches&lt;/a&gt;.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;This article presents a detailed discussion of the internal design and function of the OneNoteImporter classes, in case a developer wants to modify the classes, or just know more about how they operate internally. For a general discussion of how to use the public members of the OneNoteImporter managed assembly, see &lt;b style="mso-bidi-font-weight: normal"&gt;OneNote Import Managed Assembly: The Quick Rundown&lt;/b&gt; (&lt;/font&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2004/07/27/198813.aspx"&gt;&lt;font face="Verdana" size="2"&gt;part one&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; and &lt;/font&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2004/07/28/199832.aspx"&gt;&lt;font face="Verdana" size="2"&gt;part two&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;).&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Source files for the assembly are available from Donovan Lange's blog &lt;/font&gt;&lt;A href="http://blogs.msdn.com/dolange/archive/2004/06/17/158976.aspx"&gt;&lt;font face="Verdana" size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;. Developers are encouraged to modify the OneNoteImporter assembly as they desire and redistribute it with their application. &lt;/font&gt;&lt;/p&gt; &lt;p class="AlertText" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Note&lt;/b&gt; To avoid compatibility issues with other versions of the assembly that might be loaded on the user’s computer, include the .dll in your application directory, rather than the system directory.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;There are several basic steps in using the OneNoteImporter assembly to import content in to OneNote:&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Create the page onto which you want to import content&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Create and add the content to the page&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Import the page into the desired OneNote location&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;We’ll discuss the internal operation of the assembly classes during each of these steps.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The OneNoteImporter assembly also enables you to update and delete pages or specific content on them, as long as you know their unique identifier. This is discussed in detail later in this article.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;It’s worth noting at this point that the OneNoteImporter assembly is designed to import a single OneNote page at a time. The OneNote.SimpleImporter class can take an XML string that includes content to be imported onto multiple pages. However, when using the OneNoteImporter assembly, you create a separate XML string for each page you want to import.&lt;/font&gt;&lt;/p&gt; &lt;h5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;font face="Verdana" size="4"&gt;Examining the Classes&lt;/font&gt;&lt;/h5&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Before discussing how the classes in the assembly function internally, let’s briefly look at the abstract classes that form the basis of the assembly. There are four such classes, from which almost all of the other assembly classes derive: &lt;span class="Bold"&gt;&lt;strong&gt;ImportNode&lt;/strong&gt;&lt;/span&gt;, &lt;span class="Bold"&gt;&lt;strong&gt;PageObject&lt;/strong&gt;&lt;/span&gt;, &lt;span class="Bold"&gt;&lt;strong&gt;OutlineContent&lt;/strong&gt;&lt;/span&gt;, and &lt;span class="Bold"&gt;&lt;strong&gt;Data&lt;/strong&gt;&lt;/span&gt;.&lt;/font&gt;&lt;/p&gt; &lt;h6&gt;&lt;font face="Verdana" size="2"&gt;The ImportNode Class&lt;/font&gt;&lt;/h6&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;ImportNode&lt;/strong&gt;&lt;/span&gt; class is the base class for the entire assembly. Almost all the other classes inherit from it, including the other three abstract classes. As mentioned before, the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImporter.Import&lt;/strong&gt;&lt;/span&gt; method takes an XML string comprised of elements that detail the OneNote page and contents you want to import. The &lt;span class="Bold"&gt;&lt;strong&gt;ImportNode&lt;/strong&gt;&lt;/span&gt; represents a single node (or element) in this XML structure, such as a page, or an object on a page.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;This class provides several important pieces of common functionality:&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Serialization: The &lt;span class="Bold"&gt;&lt;strong&gt;ImportNode&lt;/strong&gt;&lt;/span&gt; contains an abstract method, &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXML&lt;/strong&gt;&lt;/span&gt;, that classes derived from it must implement. This ensures that each derived class contains the means to serialize itself into XML for the XML string passed to the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImport.Import&lt;/strong&gt;&lt;/span&gt; method. We discuss how the various classes implement this method later in the article.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Selection for importing: This class also contains an internal Boolean property, &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt;, that denotes whether or not to include this object in the XML string passed to the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImport.Import&lt;/strong&gt;&lt;/span&gt; method. By default, all objects based on the &lt;span class="Bold"&gt;&lt;strong&gt;ImportNode&lt;/strong&gt;&lt;/span&gt; or its derived classes have their &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property set to &lt;span class="Bold"&gt;&lt;strong&gt;True&lt;/strong&gt;&lt;/span&gt; when they are constructed. This denotes that the object has not yet been imported into OneNote. We also discuss how and when an object’s &lt;span class="Bold"&gt;&lt;strong&gt;CommitPending&lt;/strong&gt;&lt;/span&gt; property is changed later in this article.&lt;/font&gt;&lt;/p&gt; &lt;h6&gt;&lt;font face="Verdana" size="2"&gt;The PageObject class&lt;/font&gt;&lt;/h6&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The abstract &lt;span class="Bold"&gt;&lt;strong&gt;PageObject&lt;/strong&gt;&lt;/span&gt; class represents an object that can be added, updated, or deleted from the specified OneNote notebook page. There are three classes derived from the &lt;span class="Bold"&gt;&lt;strong&gt;PageObject&lt;/strong&gt;&lt;/span&gt; class in the assembly: &lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;ImageObject&lt;/strong&gt;&lt;/span&gt;, which represents an image, such as a jpeg or gif, on a OneNote page&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;InkObject&lt;/strong&gt;&lt;/span&gt;, which represents ink on a OneNote page&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt;, which represents an outline on a OneNote page. &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt; objects are actually comprised of other object, such as images, ink, and text described in html format.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXml&lt;/strong&gt;&lt;/span&gt; method is implemented in the &lt;span class="Bold"&gt;&lt;strong&gt;PageObject&lt;/strong&gt;&lt;/span&gt; class. It serializes the properties common to all &lt;span class="Bold"&gt;&lt;strong&gt;PageObject&lt;/strong&gt;&lt;/span&gt; classes: &lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Whether to delete the object&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;The object’s unique identifier&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;The object’s position on the page&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;It then calls the abstract &lt;span class="Bold"&gt;&lt;strong&gt;PageObject&lt;/strong&gt;&lt;/span&gt; method &lt;span class="Bold"&gt;&lt;strong&gt;SerializedObjectToXml&lt;/strong&gt;&lt;/span&gt;. All classes derived from &lt;span class="Bold"&gt;&lt;strong&gt;PageObject&lt;/strong&gt;&lt;/span&gt; must implement this method, which serializes the specific attributes of each derived class.&lt;/font&gt;&lt;/p&gt; &lt;h6&gt;&lt;font face="Verdana" size="2"&gt;The OutlineContent class&lt;/font&gt;&lt;/h6&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The abstract OutlineContent class represents an object that is part of an outline. There are three classes derived from the OutlineContent class in the assembly: &lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;HtmlContent&lt;/strong&gt;&lt;/span&gt;, which represents text on a OneNote page, described in html format.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;InkContent&lt;/strong&gt;&lt;/span&gt;, which represent ink that is part of an outline.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;ImageContent&lt;/strong&gt;&lt;/span&gt;, which represent an image that is part of an outline.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXml&lt;/strong&gt;&lt;/span&gt; method is abstract in this class; each class derived from the &lt;span class="Bold"&gt;&lt;strong&gt;OutlineContent&lt;/strong&gt;&lt;/span&gt; class must implement the serialization process.&lt;/font&gt;&lt;/p&gt; &lt;h6&gt;&lt;font face="Verdana" size="2"&gt;The Data class&lt;/font&gt;&lt;/h6&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The final abstract class, &lt;span class="Bold"&gt;&lt;strong&gt;Data&lt;/strong&gt;&lt;/span&gt;, represents the actual data of the object to be imported. For example, for an image, this would be either the path to the image file, or the base 64-encoded data of the image itself. There are three concrete derived classes for the different types of data content an object can represent: &lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;BinaryData&lt;/strong&gt;&lt;/span&gt;, which represents ink or image data that is base-64 encoded.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;FileData&lt;/strong&gt;&lt;/span&gt;, which represents the path to a source file.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;span class="Bold"&gt;&lt;strong&gt;StringData&lt;/strong&gt;&lt;/span&gt;, which represents HTML content.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;SerializeToXml&lt;/strong&gt;&lt;/span&gt; method is abstract in this class; each class derived from the &lt;span class="Bold"&gt;&lt;strong&gt;Data&lt;/strong&gt;&lt;/span&gt; class must implement the serialization process.&lt;/font&gt;&lt;/p&gt;&lt;font face="Verdana" size="2"&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;In the next entry, we'll look at creating objects.&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2005/02/15/373183.aspx"&gt;Read part two here&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=372450" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote: XML Reference Schema Download Now Live</title><link>http://blogs.msdn.com/andrew_may/archive/2005/01/13/352571.aspx</link><pubDate>Fri, 14 Jan 2005 00:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:352571</guid><dc:creator>Andrew May</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/352571.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=352571</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=352571</wfw:comment><description>&lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;For those of you who have been waiting for an actual copy of the OneNote schema, wait no more. MSDN has just republished the &lt;/font&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=fe118952-3547-420a-a412-00a2662442d9&amp;amp;displaylang=en"&gt;&lt;font face="Verdana" size="2"&gt;Office 2003: XML Reference Schemas&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; download, and this time it includes OneNote 2003 SP1. The download includes a copy of the OneNote import schema, as well as the complete &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ONXML/html/OneNoteXMLSchemaWelcome_HV01140614.asp"&gt;&lt;font face="Verdana" size="2"&gt;element, type, and attribute documentation&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; we posted online awhile back. It also include a copy of &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_on2003_ta/html/odc_ON_ImportAPI.asp"&gt;&lt;font face="Verdana" size="2"&gt;my article&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; detailing how to use the schema to import content into OneNote.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;What more could you ask for?&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Oh yeah, it includes the complete schemas and documentation for some applications called Excel, InfoPath, Project, &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:mswterms w:st="on"&gt;Visio&lt;/st1:mswterms&gt; and Word as well.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=352571" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote SDK Now Live on MSDN</title><link>http://blogs.msdn.com/andrew_may/archive/2004/11/08/254152.aspx</link><pubDate>Mon, 08 Nov 2004 22:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:254152</guid><dc:creator>Andrew May</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/254152.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=254152</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=254152</wfw:comment><description>&lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Here's something that was published on MSDN last week that you might have missed: the &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ONXML/html/OneNoteXMLSchemaWelcome_HV01140614.asp"&gt;&lt;font face="Verdana" size="2"&gt;OneNote Software Developers Kit (SDK)&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Because the developer functionality in OneNote SP1 primarily consists of the SimpleImport interface, the OneNote SDK provides a full schema reference. Each element and type in the schema gets its own topic, complete with a full description and usage example. So if you're looking for detailed definitions of schema elements, this is just the reference you want.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The SDK should be available soon as a download as well. I'll let you know when that happens as well. In the meantime, check out the online version.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=254152" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote: Positioning Imported Content on Right-To-Left Pages</title><link>http://blogs.msdn.com/andrew_may/archive/2004/08/04/208041.aspx</link><pubDate>Wed, 04 Aug 2004 16:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:208041</guid><dc:creator>Andrew May</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/208041.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=208041</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=208041</wfw:comment><description>&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Here&amp;#8217;s something I found in a code comment in the &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/dolange/archive/2004/06/17/158976.aspx"&gt;&lt;FONT face=Verdana size=2&gt;OneNoteImporter managed assembly source code&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;. It applies to both the OneNoteImporter and the SimpleImporter API itself, and I haven&amp;#8217;t seen it documented anywhere else, so I thought I&amp;#8217;d pass it on here.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;It concerns positioning objects on OneNote pages that read right-to-left. If you&amp;#8217;ve used either the OneNoteImporter and the SimpleImporter API itself, you know you can use the RTL attribute of the &amp;lt;Page&amp;gt; element to set whether you want the page to read right-to-left or vice versa. You can then set the x and y attributes of an object&amp;#8217;s &amp;lt;Position&amp;gt; element to determine where you want the object placed on the page. (If you&amp;#8217;re using the OneNoteImporter assembly, then set the &lt;B style="mso-bidi-font-weight: normal"&gt;RTL&lt;/B&gt; property of the &lt;B style="mso-bidi-font-weight: normal"&gt;Page&lt;/B&gt; object, and the &lt;B style="mso-bidi-font-weight: normal"&gt;X&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;Y&lt;/B&gt; properties of the &lt;B style="mso-bidi-font-weight: normal"&gt;Position&lt;/B&gt; object, respectively.)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;OneNote places the objects it imports onto the page based on absolute coordinates, expressed in points. Turns out that the coordinates differ, based on whether the page reads left-to-right or right-to-left.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Here&amp;#8217;s how it works:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;If you set the page to read left-to-right, then the origin (that is, the place there both &lt;I style="mso-bidi-font-style: normal"&gt;x&lt;/I&gt; and &lt;I style="mso-bidi-font-style: normal"&gt;y&lt;/I&gt; equal 0) is the upper left hand corner of the OneNote page. &lt;I style="mso-bidi-font-style: normal"&gt;X&lt;/I&gt; coordinates advance in positive numbering from the left to the right; &lt;I style="mso-bidi-font-style: normal"&gt;y&lt;/I&gt; coordinates advance in positive numbering horizontally down the page. Pretty straightforward.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Things get a little more complicated when you set the page to read right-to-left. In this case, the origin (0,0) is the upper right hand corner. But the x and y coordinates still advance in positive numbering in the same directions: &lt;I style="mso-bidi-font-style: normal"&gt;x&lt;/I&gt; to the left, &lt;I style="mso-bidi-font-style: normal"&gt;y&lt;/I&gt; horizontally down the page. So for any objects on a right-to-left OneNote page, the &lt;I style="mso-bidi-font-style: normal"&gt;x&lt;/I&gt; coordinate will actually be a &lt;I style="mso-bidi-font-style: normal"&gt;negative&lt;/I&gt; number. Indeed, the &lt;I style="mso-bidi-font-style: normal"&gt;x&lt;/I&gt; coordinates are increasingly negative as you to the left across the page.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Also remember that the &lt;I style="mso-bidi-font-style: normal"&gt;x&lt;/I&gt; coordinate refers to the upper left corner of the object, regardless of the direction in which the OneNote page reads.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;So let&amp;#8217;s look at an example. The figure below represents a OneNote page, set to read right-to-left. For the sake of argument, assume the page is 600 pixels wide by 750 pixels long (I have no idea what the default size of a OneNote page is.) In this case, the upper left corner coordinates are (-600, 0); the lower left corner coordinates are (-600, 750). The (x, y) coordinates of the object &lt;B style="mso-bidi-font-weight: normal"&gt;A&lt;/B&gt; refer to the position of the upper &lt;I style="mso-bidi-font-style: normal"&gt;left&lt;/I&gt; corner, and so would be (-400, 100), and not (-250, 100), which is the object&amp;#8217;s upper right corner.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Make sense?&lt;/FONT&gt;&lt;/P&gt;&lt;IMG src="http://ajmay2.home.comcast.net/blogart/ON_RTL_example.gif"&gt; 
&lt;P class=Figure style="MARGIN: 3pt 0in 9pt"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;&lt;v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:formulas&gt;&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"&gt;&lt;/v:path&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:lock v:ext="edit" aspectratio="t"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&amp;nbsp;&lt;FONT face=Verdana size=2&gt;One last thing: you should also consider page margins when positioning an object on the page. While (0,0) is the absolute origin of the page, depending on user&amp;#8217;s preference, their upper left hand corner margin should be at (&amp;#189;&amp;#8221;,&amp;#189;&amp;#8221;), or (36,36) in points. Which is (-36,36) if the page reads right-to-left.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=208041" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote import Managed Assembly: Customizing How OneNote Launches</title><link>http://blogs.msdn.com/andrew_may/archive/2004/08/03/207342.aspx</link><pubDate>Tue, 03 Aug 2004 21:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:207342</guid><dc:creator>Andrew May</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/207342.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=207342</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=207342</wfw:comment><description>&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Here&amp;#8217;s still more functionality packed into the &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/dolange/archive/2004/06/17/158976.aspx"&gt;&lt;FONT face=Verdana size=2&gt;OneNoteImporter assembly&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;You can also modify how OneNote starts by using the following methods of the Application object. These methods &amp;#8216;wrap&amp;#8217; command line switches that customize how the OneNote application starts.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;The table below lists the &lt;B style="mso-bidi-font-weight: normal"&gt;Application&lt;/B&gt; object methods, and the command line switch each invokes. If a method is overloaded, the number of overloads is noted next to the method name. In most cases, the method is overloaded to account for the fact that the command line switch takes a series of optional string arguments. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;All the method parameters take strings, except the &lt;SPAN class=Italic&gt;&lt;EM&gt;openReadonly&lt;/EM&gt;&lt;/SPAN&gt; parameter of the &lt;B style="mso-bidi-font-weight: normal"&gt;Open&lt;/B&gt; method, which takes a Boolean value.&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 436.7pt; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 width=582 border=1&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes"&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 136.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width=182&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN class=Bold&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;Application method&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 160.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=215&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN class=Bold&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;Parameters&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 139.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=186&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN class=Bold&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;Command line switch&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 1"&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 136.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=182&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;JoinSharedSession (2)&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 160.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=215&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;(sessionAddress)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;(sessionAddress, password, sectionPath)&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 139.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=186&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;/joinsharing&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 2"&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 136.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=182&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Open (2)&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 160.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=215&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;(sectionPath)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;(sectionPath, openReadonly)&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 139.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=186&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;/openro&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 3"&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 136.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=182&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;PauseRecording&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 160.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=215&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;()&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 139.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=186&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;/pauserecording&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 4"&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 136.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=182&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Print&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 160.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=215&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;(sectionPath)&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 139.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=186&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;/print&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 5"&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 136.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=182&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;StartAudioNote&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 160.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=215&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;()&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 139.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=186&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;/audionote&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 6"&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 136.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=182&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;StartSharedSession (3)&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 160.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=215&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;()&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;(sectionPath)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;(sectionPath, password)&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 139.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=186&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;/startsharing&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 7"&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 136.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=182&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;StartSideNote&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 160.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=215&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;()&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 139.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=186&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;/sidenote&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 8"&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 136.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=182&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;StartVideoNote (4)&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 160.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=215&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;()&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;(recordingProfilepath)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;(videoDevice, audioDevice)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;(videoDevice, audioDevice, recordingProfilepath)&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 139.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=186&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;/videonote&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 9; mso-yfti-lastrow: yes"&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 136.3pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=182&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;StopRecording&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 160.9pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=215&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;()&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 139.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=186&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;/stoprecording&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=TableSpacingAfter style="MARGIN: 3pt 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=1&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Be aware that these Application methods have been implemented as asynchronous command line calls. Because of this, your code continues to run after it calls Application method is called, independent of whether or not the OneNote application has yet launched.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;In addition, you can use the &lt;B style="mso-bidi-font-weight: normal"&gt;Activate&lt;/B&gt; method to bring the OneNote application to the foreground.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;For more information on the command line switches, see &lt;SPAN style="mso-bidi-font-size: 13.0pt"&gt;&lt;A href="http://www.msdn.microsoft.com/office/default.aspx?pull=/library/en-us/odc_on2003_ta/html/odc_ON_CLSwitches.asp"&gt;Customizing OneNote 2003 SP 1 Using New Command Line Switches&lt;/A&gt;.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Is there anything these guys didn&amp;#8217;t think of?&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=207342" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote Import Managed Assembly: The Quick Rundown (2 of 2)</title><link>http://blogs.msdn.com/andrew_may/archive/2004/07/28/199832.aspx</link><pubDate>Wed, 28 Jul 2004 16:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:199832</guid><dc:creator>Andrew May</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/199832.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=199832</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=199832</wfw:comment><description>&lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;In &lt;/font&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2004/07/27/198813.aspx"&gt;&lt;font face="Verdana" size="2"&gt;part one&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;, we discussed how to use the OneNote managed class assembly to import content into OneNote. Now let’s actually look at the XML the Page class generates for the SimpleImporter.Import method.&lt;/font&gt;&lt;/p&gt; &lt;h6&gt;&lt;font face="Verdana" size="2"&gt;Looking at the XML&lt;/font&gt;&lt;/h6&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;If you want to preview what the XML that’s passed to the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImport.Import&lt;/strong&gt;&lt;/span&gt; method will look like before you run the &lt;span class="Bold"&gt;&lt;strong&gt;Commit&lt;/strong&gt;&lt;/span&gt; method, call the &lt;span class="Bold"&gt;&lt;strong&gt;Page.ToString&lt;/strong&gt;&lt;/span&gt; method. This is the method that actually serializes the page and its contents to XML prior to importing. Just remember that once you’ve committed a page, none of the object on that page will be included in the generated import XML, unless they’ve subsequently been modified in some way.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Also remember that the &lt;b style="mso-bidi-font-weight: normal"&gt;Commit&lt;/b&gt; method generates import XML with both &amp;lt;EnsurePage&amp;gt; and &amp;lt;PlaceObjects&amp;gt; elements for that page. Specifying an &amp;lt;EnsurePage&amp;gt; element for a page guarantees that the page exists before OneNote attempts to import objects onto it. So if your application includes a scenario where you only want to import objects onto a page if the page &lt;i style="mso-bidi-font-style: normal"&gt;already&lt;/i&gt; exists, you’ll need to modify this method, or use another means.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;So let’s a quick look at the code sample Donovan gives over on his blog (I think he’ll forgive me if I rewrite it in VB). This sample creates a new page, title “General”, with one object on that page: an outline containing the text “Hello &lt;i style="mso-bidi-font-style: normal"&gt;world&lt;/i&gt;!”&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt; tab-stops: .25in"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; TrivialImportVB()&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt; tab-stops: .25in"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; p &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; Page("General")&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt; tab-stops: .25in"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; outline &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;New&lt;/span&gt; OutlineObject&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt; tab-stops: .25in"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;outline.AddContent(&lt;span style="COLOR: blue"&gt;New&lt;/span&gt; HtmlContent("Hello &amp;lt;i&amp;gt;world&amp;lt;/i&amp;gt;!"))&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt; tab-stops: .25in"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;p.AddObject(outline)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt; tab-stops: .25in"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;p.Commit()&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt; tab-stops: .25in"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;p.NavigateTo()&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt; tab-stops: .25in"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;And here’s the resulting XML that gets passed to the &lt;span class="Bold"&gt;&lt;strong&gt;SimpleImport.Import&lt;/strong&gt;&lt;/span&gt; method. Notice that the necessary GUIDs are there, and the HTML has even been cleaned up so that OneNote accepts it with no problem. How’s that for service?&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font face="Courier New" size="2"&gt;&amp;lt;?xml version="1.0" encoding="utf-16"?&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font face="Courier New" size="2"&gt;&amp;lt;Import xmlns="http://schemas.microsoft.com/office/onenote/01/2004/import"&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;EnsurePage path="General" guid="{e5bf863a-7070-4058-a0f5-&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt; TEXT-INDENT: 0.25in"&gt;&lt;font face="Courier New" size="2"&gt;343e4a45dc05}" date="2004-07-23T09:52:17.0963010-07:00" /&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;PlaceObjects pagePath="General" pageGuid="{e5bf863a-7070-4058-a0f5-&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;343e4a45dc05}"&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;Object guid="{a5af80e4-8105-4109-b3ac-538851e9e3fa}"&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;Position x="36" y="36" /&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;Outline&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-tab-count: 5"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;Html&amp;gt;&amp;lt;Data&amp;gt;&amp;lt;![CDATA[&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;Hello &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt 1in; TEXT-INDENT: 0.25in"&gt;&lt;font face="Courier New" size="2"&gt;&amp;lt;i&amp;gt;world&amp;lt;/&amp;gt;!&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;]]&amp;gt;&amp;lt;/Data&amp;gt;&amp;lt;/Html&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/Outline&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/Object&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/PlaceObjects&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 0in 0in 3pt"&gt;&lt;font face="Courier New" size="2"&gt;&amp;lt;/Import&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;h5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;font face="Verdana" size="4"&gt;Object Model Diagrams&lt;/font&gt;&lt;/h5&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;And what’s an object model without an object model map? Anyone who’s read this blog has probably realized how fond I am of presenting technical information graphically (which I’m sure has nothing to do with my being the programmer-writer for PowerPoint and Publisher.) So here are some diagrams of how the classes fit together. But first, some caveats:&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The following diagrams show only the public members of each class. None of the abstract classes are diagramed, and I’ve left any inheritance information off the diagrams, although I’ve listed any members that a class inherits in the individual classes themselves. For example, &lt;span class="Bold"&gt;&lt;strong&gt;ImageObject&lt;/strong&gt;&lt;/span&gt;, &lt;span class="Bold"&gt;&lt;strong&gt;InkObject&lt;/strong&gt;&lt;/span&gt;, and &lt;span class="Bold"&gt;&lt;strong&gt;OutlineObject&lt;/strong&gt;&lt;/span&gt; all inherit the &lt;span class="Bold"&gt;&lt;strong&gt;Height&lt;/strong&gt;&lt;/span&gt;, &lt;span class="Bold"&gt;&lt;strong&gt;Position&lt;/strong&gt;&lt;/span&gt;, and &lt;span class="Bold"&gt;&lt;strong&gt;Width&lt;/strong&gt;&lt;/span&gt; properties from the abstract class &lt;span class="Bold"&gt;&lt;strong&gt;PageObject&lt;/strong&gt;&lt;/span&gt;, which is not diagrammed.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;I mainly want to show how the various object relate to one another. For the most part, if a member gets or sets a data type, I haven’t bothered showing that in the diagram. In addition, for the sake of clarity, I’ve left off the following information for basic methods that most classes here have:&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;Clone&lt;/strong&gt;&lt;/span&gt; method returns the type of object from which you call it.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;Equals&lt;/strong&gt;&lt;/span&gt; method takes a &lt;span class="Bold"&gt;&lt;strong&gt;System.Object&lt;/strong&gt;&lt;/span&gt; as a parameter.&lt;/font&gt;&lt;/p&gt; &lt;p class="BulletedList1" style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;The &lt;span class="Bold"&gt;&lt;strong&gt;GetHashCode&lt;/strong&gt;&lt;/span&gt; method returns a &lt;span class="Bold"&gt;&lt;strong&gt;System.Int32&lt;/strong&gt;&lt;/span&gt; suitable for use in hashing algorithms and data structures like a hash table.&lt;/font&gt;&lt;/p&gt; &lt;p class="Text" style="MARGIN: 3pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Trust me, I’ve got much more detailed diagrams of the internal workings of each class tacked up around my office, and those will most likely make it into the finished article, which discusses the class source code. But these should give you a good at-a-glance idea of how things flow.&lt;/font&gt;&lt;/p&gt; &lt;p class="Figure" style="MARGIN: 3pt 0in 9pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;img src="http://ajmay2.home.comcast.net/blogart/ODC_ON_ImportClass_1.gif" /&gt; &lt;p class="Label" style="MARGIN: 3pt 0in"&gt;&lt;strong&gt;&lt;font face="Verdana" size="2"&gt;Figure 1. Page object (and legend)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="Figure" style="MARGIN: 3pt 0in 9pt"&gt;&lt;o:p&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;img src="http://ajmay2.home.comcast.net/blogart/ODC_ON_ImportClass_2a.gif" /&gt;&lt;img src="http://ajmay2.home.comcast.net/blogart/ODC_ON_ImportClass_2b.gif" /&gt; &lt;p class="Label" style="MARGIN: 3pt 0in"&gt;&lt;strong&gt;&lt;font face="Verdana" size="2"&gt;Figure 2. ImageObject, InkObject, and OutlineObject&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="Figure" style="MARGIN: 3pt 0in 9pt"&gt;&lt;o:p&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;img src="http://ajmay2.home.comcast.net/blogart/ODC_ON_ImportClass_3.gif" /&gt; &lt;p class="Label" style="MARGIN: 3pt 0in"&gt;&lt;strong&gt;&lt;font face="Verdana" size="2"&gt;Figure 3. HtmlContent, ImageContent, and InkContent&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=199832" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/Code+snippets/default.aspx">Code snippets</category><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote Import Managed Assembly: The Quick Rundown (1 of 2)</title><link>http://blogs.msdn.com/andrew_may/archive/2004/07/27/198813.aspx</link><pubDate>Tue, 27 Jul 2004 18:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:198813</guid><dc:creator>Andrew May</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/198813.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=198813</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=198813</wfw:comment><description>&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;If you haven&amp;#8217;t already seen this, get over to &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/dolange/archive/2004/06/17/158976.aspx"&gt;&lt;FONT face=Verdana size=2&gt;Donovan Lange&amp;#8217;s blog&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;. Donovan, &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/omars/"&gt;&lt;FONT face=Verdana size=2&gt;Omar&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;, and David have put together an abstracted managed assembly that provides an object model for the SimpleImport functionality OneNote added for &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/office/onenote/prodinfo/sp1/default.mspx"&gt;&lt;FONT face=Verdana size=2&gt;SP1&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;. That&amp;#8217;s right; you don&amp;#8217;t even have to create the XML for the import yourself. The OneNote guys have you covered.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;I&amp;#8217;m currently putting together an article that highlights this class library and all the functionality it provides. I&amp;#8217;ve been pouring over the code for the last week or so, and I think I&amp;#8217;ve finally got it. (The assembly itself is written in C#. Did I mention I&amp;#8217;m about as fluent in C# as in ancient Armenian?) I have to say, this is some very well-thought-out work.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;The OneNote guys have included detailed technical documentation in the download itself, but I thought it might be worth taking a few minutes and putting together a high-level overview of how the classes work. So if you just want to get up and running, and aren&amp;#8217;t too concerned about how the assembly does what it does so well, then read on.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;I&amp;#8217;m going to assume you have a passing familiarity with the &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/office/default.aspx?pull=/library/en-us/odc_on2003_ta/html/odc_ON_ImportAPI.asp"&gt;&lt;FONT face=Verdana size=2&gt;OneNote SimpleImport class&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; and the &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2004/04/22/118304.aspx"&gt;&lt;FONT face=Verdana size=2&gt;xml schema&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; it uses. (If you don&amp;#8217;t, follow the links and then come back. I&amp;#8217;ll wait.)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;They&amp;#8217;ve really made the class library easy to use. Here&amp;#8217;s all you need to do:&lt;/FONT&gt;&lt;/P&gt;
&lt;H5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana size=4&gt;Create a new Page object&lt;/FONT&gt;&lt;/H5&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Not much to say here. Once you&amp;#8217;ve created the page, you can set its attributes using various properties such as &lt;B style="mso-bidi-font-weight: normal"&gt;Date&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;PreviousPage&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;RTL&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;SectionPath&lt;/B&gt;, and &lt;B style="mso-bidi-font-weight: normal"&gt;Title&lt;/B&gt;. The &lt;B style="mso-bidi-font-weight: normal"&gt;PreviousPage&lt;/B&gt; property sets the value of the &amp;#8216;InsertAfter&amp;#8217; XML attribute; the others are pretty self-explanatory.&lt;/FONT&gt;&lt;/P&gt;
&lt;H5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana size=4&gt;Create the content you want to add to your new page&lt;/FONT&gt;&lt;/H5&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;There are three types of objects you can add to a page: &lt;B style="mso-bidi-font-weight: normal"&gt;ImageObject&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;InkObject&lt;/B&gt;, or &lt;B style="mso-bidi-font-weight: normal"&gt;OutlineObject &lt;/B&gt;objects. All page objects share common properties, such as &lt;B style="mso-bidi-font-weight: normal"&gt;Height&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;Width&lt;/B&gt;, and &lt;B style="mso-bidi-font-weight: normal"&gt;Position&lt;/B&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=TextIndented style="MARGIN: 3pt 0.25in"&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Note&lt;/B&gt; While the &lt;B style="mso-bidi-font-weight: normal"&gt;OutlineObject&lt;/B&gt; inherits the &lt;B style="mso-bidi-font-weight: normal"&gt;Height&lt;/B&gt; property from its base class for consistency, outlines cannot have an explicitly specified height. Therefore, accessing or modifying the Height property of an OutlineObject will result in an error.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Each &lt;B style="mso-bidi-font-weight: normal"&gt;ImageObject&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;InkObject&lt;/B&gt; contains data representing the actual image or ink content you want to add to the page. You get and set this data by using the &lt;B style="mso-bidi-font-weight: normal"&gt;ImageData&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;InkData&lt;/B&gt; properties, respectively.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;You use these properties to get or set a &lt;B style="mso-bidi-font-weight: normal"&gt;BinaryData &lt;/B&gt;or &lt;B style="mso-bidi-font-weight: normal"&gt;FileData &lt;/B&gt;object. The &lt;B style="mso-bidi-font-weight: normal"&gt;BinaryData &lt;/B&gt;class represents raw binary data in memory. When you add an &lt;B style="mso-bidi-font-weight: normal"&gt;ImageObject&lt;/B&gt; or &lt;B style="mso-bidi-font-weight: normal"&gt;InkObject&lt;/B&gt; object containing &lt;B style="mso-bidi-font-weight: normal"&gt;BinaryData&lt;/B&gt; to a page, the OneNote Import Managed Assembly ensures this data is properly base-64 encoded. The &lt;B style="mso-bidi-font-weight: normal"&gt;FileData &lt;/B&gt;class represents data that is stored in an external file, and is marshaled to OneNote as a file path.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;For the most part, you&amp;#8217;ll really only need to create &lt;B style="mso-bidi-font-weight: normal"&gt;BinaryData&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;FileData&lt;/B&gt; objects directly when you want to update existing image or ink objects. The &lt;B style="mso-bidi-font-weight: normal"&gt;ImageObject &lt;/B&gt;and &lt;B style="mso-bidi-font-weight: normal"&gt;InkObject &lt;/B&gt;each provide convenience constructors that create the appropriate data object, when passed a &lt;B style="mso-bidi-font-weight: normal"&gt;System.IO.FileInfo &lt;/B&gt;object or binary array of bytes as a method parameter.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;OutlineObject&lt;/B&gt; objects&lt;B style="mso-bidi-font-weight: normal"&gt; &lt;/B&gt;are slightly more complex because outlines can be comprised of &lt;B style="mso-bidi-font-weight: normal"&gt;ImageContent&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;InkContent&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;HtmlContent &lt;/B&gt;objects. Add content to an &lt;B style="mso-bidi-font-weight: normal"&gt;OutlineObject&lt;/B&gt; using the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;AddContent&lt;/STRONG&gt;&lt;/SPAN&gt; method. Outline content objects are displayed within the outline in the same order in which they are added to the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;OutlineObject&lt;/STRONG&gt;&lt;/SPAN&gt; object.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;The &lt;SPAN class=Bold&gt;&lt;STRONG&gt;ImageContent&lt;/STRONG&gt;&lt;/SPAN&gt; and &lt;SPAN class=Bold&gt;&lt;STRONG&gt;InkContent&lt;/STRONG&gt;&lt;/SPAN&gt; classes are very similar to the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;ImageObject&lt;/STRONG&gt;&lt;/SPAN&gt; and &lt;SPAN class=Bold&gt;&lt;STRONG&gt;InkObject&lt;/STRONG&gt;&lt;/SPAN&gt; classes. Again, the actual image or ink content is represented by either a &lt;SPAN class=Bold&gt;&lt;STRONG&gt;BinaryData&lt;/STRONG&gt;&lt;/SPAN&gt; or &lt;SPAN class=Bold&gt;&lt;STRONG&gt;FileData&lt;/STRONG&gt;&lt;/SPAN&gt; object. This object is also created based on the specified argument passed to the ImageContent or InkContent constructor, and you can subsequently access it using the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;ImageData&lt;/STRONG&gt;&lt;/SPAN&gt; or &lt;B style="mso-bidi-font-weight: normal"&gt;InkData &lt;/B&gt;property, respectively. Note that neither the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;ImageContent&lt;/STRONG&gt;&lt;/SPAN&gt; or &lt;SPAN class=Bold&gt;&lt;STRONG&gt;InkContent&lt;/STRONG&gt;&lt;/SPAN&gt; classes contain properties for setting their position and size on the page, as these properties are set for the outline as a whole.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;The &lt;SPAN class=Bold&gt;&lt;STRONG&gt;HtmlContent&lt;/STRONG&gt;&lt;/SPAN&gt; object also contains data within the &lt;B style="mso-bidi-font-weight: normal"&gt;HtmlData&lt;/B&gt; property, except it&amp;#8217;s data is represented as either a &lt;SPAN class=Bold&gt;&lt;STRONG&gt;FileData&lt;/STRONG&gt;&lt;/SPAN&gt; or &lt;SPAN class=Bold&gt;&lt;STRONG&gt;StringData&lt;/STRONG&gt;&lt;/SPAN&gt; object. The &lt;SPAN class=Bold&gt;&lt;STRONG&gt;StringData&lt;/STRONG&gt;&lt;/SPAN&gt; object represent string data as a System.String. Constructors on the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;HtmlContent&lt;/STRONG&gt;&lt;/SPAN&gt; object enable you to create a new &lt;SPAN class=Bold&gt;&lt;STRONG&gt;HtmlContent&lt;/STRONG&gt;&lt;/SPAN&gt; object based off of pre-existing HTML in a string object or a &lt;SPAN class=Bold&gt;&lt;STRONG&gt;FileInfo&lt;/STRONG&gt;&lt;/SPAN&gt; object containing the path to an HTML file. &lt;/FONT&gt;&lt;/P&gt;
&lt;H5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana size=4&gt;Add objects to the page&lt;/FONT&gt;&lt;/H5&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Add the objects you&amp;#8217;ve created to the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Page&lt;/STRONG&gt;&lt;/SPAN&gt; object using the &lt;B style="mso-bidi-font-weight: normal"&gt;AddObject&lt;/B&gt; method. You can add as many as you want, in any order. How the objects are arranged on the page depends on the coordinates specified in the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Position&lt;/STRONG&gt;&lt;/SPAN&gt; child object for each &lt;SPAN class=Bold&gt;&lt;STRONG&gt;ImageObject&lt;/STRONG&gt;&lt;/SPAN&gt;, &lt;SPAN class=Bold&gt;&lt;STRONG&gt;InkObject&lt;/STRONG&gt;&lt;/SPAN&gt;, or &lt;SPAN class=Bold&gt;&lt;STRONG&gt;OutlineObject&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;H5 style="MARGIN: 9pt 0in 3pt"&gt;&lt;FONT face=Verdana size=4&gt;Import the page&lt;/FONT&gt;&lt;/H5&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Now that you&amp;#8217;ve got your page set up with all your content, it&amp;#8217;s time to import it into OneNote. You do this using the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Page.Commit&lt;/STRONG&gt;&lt;/SPAN&gt; method. This method does several vital things, including:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=2&gt;&amp;#183;&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;Creates the XML document to be used for the OneNote SimpleImport class.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=2&gt;&amp;#183;&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;Specifies the correct OneNote namespace, based on whether the OneNote SP1 Preview or SP1 release version is installed on the current machine. (Now, how thoughtful is that?)&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=2&gt;&amp;#183;&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;Adds an &amp;lt;EnsurePage&amp;gt; element for the page, using the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Page&lt;/STRONG&gt;&lt;/SPAN&gt; object properties you&amp;#8217;ve set.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=2&gt;&amp;#183;&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;If your page contains objects, then the method also creates a &amp;lt;PlaceObjects&amp;gt; element to insert, edit, or delete those objects as specified.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=2&gt;&amp;#183;&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;Serializes the page and all its contents to XML, and adds them to the XML import document. In the course of this, it also does some minor checking of any HTML content to format it property for OneNote. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=2&gt;&amp;#183;&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;Validates the XML it created, to make sure OneNote accepts it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=2&gt;&amp;#183;&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;Calls the SimpleImporter class and imports the content into OneNote.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Pretty slick, no?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Here&amp;#8217;s some things to keep in mind:&lt;/FONT&gt;&lt;/P&gt;
&lt;H6&gt;&lt;FONT face=Verdana size=2&gt;Generating GUIDs&lt;/FONT&gt;&lt;/H6&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;The OneNote classes internally generate the necessary GUIDs that OneNote needs to identify each object and page. You cannot access a page or object&amp;#8217;s GUID from outside the OneNote class assembly. The GUIDs do appear in the XML passed to the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;SimpleImporter.Import&lt;/STRONG&gt;&lt;/SPAN&gt; method, of course.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;On a sidenote, Donovan tells me he intends to change this. Originally, the intent was to hide the GUIDs for the benefit of new users. But it turns out that many scenerios require control over the Page and PageObject GUIDs. If you do need access to these GUIDs, here&amp;#8217;s two strategies to consider:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=2&gt;&amp;#183;&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;Override the class, and make the GUID properties publicly accessible.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=BulletedList1 style="MARGIN: 3pt 0in 3pt 0.25in"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=2&gt;&amp;#183;&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;Serialize and persist the Page object between sessions, and then deserialize it as necessary.&lt;/FONT&gt;&lt;/P&gt;
&lt;H6&gt;&lt;FONT face=Verdana size=2&gt;Re-Importing Objects&lt;/FONT&gt;&lt;/H6&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Page&lt;/B&gt; objects keep track of whether they have been committed (or in other words, imported) and, additionally, keep track of modifications that require an update (that is, another import). So, after you commit a &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Page &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class=Bold&gt;&lt;SPAN style="FONT-WEIGHT: normal"&gt;for the first time&lt;/SPAN&gt;&lt;/SPAN&gt;, if you then immediately call the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Commit&lt;/STRONG&gt;&lt;/SPAN&gt; method again, none of the original objects would be re-imported. However, suppose that, after you commit a page, you then added new objects to that page, or changed the content or properties of an existing object on the page. In that case those new or modified objects will be re-imported the next time you execute the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Commit&lt;/STRONG&gt;&lt;/SPAN&gt; method.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;The OneNote SimpleImport API does not permit you to change a page&amp;#8217;s date, title, insertAfter, or RTL attributes once you&amp;#8217;ve imported the page. Because of this, once you&amp;#8217;ve called the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Commit&lt;/STRONG&gt;&lt;/SPAN&gt; method for a &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Page&lt;/STRONG&gt;&lt;/SPAN&gt; object, the following &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Page&lt;/STRONG&gt;&lt;/SPAN&gt; properties become read-only and throw an exception if you try and set them: &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;, &lt;SPAN class=Bold&gt;&lt;STRONG&gt;PreviousPage&lt;/STRONG&gt;&lt;/SPAN&gt;, &lt;SPAN class=Bold&gt;&lt;STRONG&gt;RTL&lt;/STRONG&gt;&lt;/SPAN&gt;, and &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Title&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;H6&gt;&lt;FONT face=Verdana size=2&gt;Deleting Objects&lt;/FONT&gt;&lt;/H6&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;You can delete an object from a page using the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Page.DeleteObject&lt;/STRONG&gt;&lt;/SPAN&gt; method. Much like the &lt;B style="mso-bidi-font-weight: normal"&gt;Page.AddObject &lt;/B&gt;method, the deletion does not in fact occur until you execute &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Commit &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class=Bold&gt;&lt;SPAN style="FONT-WEIGHT: normal"&gt;method&lt;/SPAN&gt;&lt;/SPAN&gt;; only then is it deleted within OneNote and removed as a child of the &lt;SPAN class=Bold&gt;&lt;STRONG&gt;Page&lt;/STRONG&gt;&lt;/SPAN&gt; object.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Next time, I'll include an example and we'll take a look at the XML actually produced.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=198813" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/Code+snippets/default.aspx">Code snippets</category><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote 2003 SP1 Preview Documentation Live On MSDN</title><link>http://blogs.msdn.com/andrew_may/archive/2004/06/10/152809.aspx</link><pubDate>Thu, 10 Jun 2004 17:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:152809</guid><dc:creator>Andrew May</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/152809.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=152809</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=152809</wfw:comment><description>&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;&lt;FONT face=Verdana&gt;The title pretty much says it all. The final versions of the OneNote SP1 Preview documentation I posted here in draft version about a month ago went live on MSDN last night:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;&lt;A href="http://msdn.microsoft.com/office/default.aspx?pull=/library/en-us/odc_on2003_ta/html/odc_ON_ImportAPI.asp"&gt;&lt;FONT face=Verdana&gt;Importing Content into OneNote 2003 SP1 Preview&lt;/FONT&gt;&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;&lt;A href="http://msdn.microsoft.com/office/default.aspx?pull=/library/en-us/odc_on2003_ta/html/odc_ON_CLSwitches.asp"&gt;&lt;FONT face=Verdana&gt;Customizing OneNote 2003 SP 1 Using New Command Line Switches&lt;/FONT&gt;&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;SPAN style="FONT-SIZE: 9pt"&gt;&lt;FONT face=Verdana&gt;So we&amp;#8217;ve pulled together the information from my assorted blog entries, cleaned it up, and made it ready for prime time. It&amp;#8217;s worth taking a look at, even if you&amp;#8217;ve already read the original blog entries. And do me a favor: rate the articles. It&amp;#8217;s the only way we know if we&amp;#8217;re addressing your needs. Thanks.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=152809" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item><item><title>OneNote Namespace Change for SP1</title><link>http://blogs.msdn.com/andrew_may/archive/2004/05/12/130741.aspx</link><pubDate>Wed, 12 May 2004 21:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:130741</guid><dc:creator>Andrew May</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/andrew_may/comments/130741.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrew_may/commentrss.aspx?PostID=130741</wfw:commentRss><wfw:comment>http://blogs.msdn.com/andrew_may/rsscomments.aspx?PostID=130741</wfw:comment><description>&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;Here&amp;#8217;s a heads-up for developers that are using the SimpleImport interface available in the &lt;SPAN style="FONT-SIZE: 11pt"&gt;&lt;A href="http://www.microsoft.com/office/onenote/prodinfo/sp1/default.mspx"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;OneNote 2003 Service Pack 1 (SP1) Preview&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;. Be advised that the namespace for the Import method will be different in the final released SP1 from what it is in the Preview version.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;The current namespace for the OneNote SP1 &lt;B style="mso-bidi-font-weight: normal"&gt;Preview&lt;/B&gt; is:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=TextIndented style="MARGIN: 3pt 0.25in"&gt;&lt;FONT face=Verdana size=2&gt;http://schemas.microsoft.com/office/onenote/01/2004/import&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;While the final namespace for OneNote SP1 will be:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=TextIndented style="MARGIN: 3pt 0.25in"&gt;&lt;FONT face=Verdana size=2&gt;http://schemas.microsoft.com/office/onenote/2004/import&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;From what I understand, it&amp;#8217;s become standard procedure here in Office to use a &amp;#8216;beta&amp;#8217; namespace for early versions of a product, and then switch to another namespace once the schema has been finalized. Just be advised that if you&amp;#8217;re programming against the Preview namespace, you&amp;#8217;ll need to update your code for the new namespace in order for it to be compatible with the final OneNote SP1, once it&amp;#8217;s released.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Text style="MARGIN: 3pt 0in"&gt;&lt;FONT face=Verdana size=2&gt;I&amp;#8217;ve already edited my &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/andrew_may/archive/2004/04/22/118321.aspx"&gt;&lt;FONT face=Verdana size=2&gt;blog entry&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; detailing how to use the SimpleImport functionality, but I wanted to call this out in a separate entry for anyone who&amp;#8217;s already using the documentation.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=130741" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrew_may/archive/tags/OneNote/default.aspx">OneNote</category></item></channel></rss>