February, 2007

  • Engineering OneNote Blog

    A teaser on how OneNote storage and replication works


    The other day someone internally was asking how OneNote stored its files and how often the save behaviour actually happened. You know if you were to pull the power cord on your computer what would you lose and what wouldn't you lose? Well Irina Yatsenko from the OneNote Test team wrote up the following to answer the question and she wanted me to post it for all to see:

    Now, I'll describe in more details what we do in OneNote 2007:

    1. Internally all data from a single paragraph on a page up to a notebook are represented in a graph, which is split in areas we call "graph spaces". This allows us to load/save incrementally per a graph space, so when you open a notebook, you'd see all section tabs popping up almost immediately though pages inside those sections aren't yet loaded. When saving we can also choose which piece to save, rather than saving everything.
    2. We never save directly to the server hosting the files (even if it's a local machine). First we save into local cache file. Because the cache is local and OneNote has exclusive access to it, we can guarantee that save always succeeds (if not, OneNote will force an exit, because running without a cache means users might lose data, and we think it's better to exit then lose data). Save into cache happens every 30 sec or on exit ([descapa] I have found this to be faster at times though I am not pulling my power cord out)
    3. To propagate the data from the cache back to the original location of the sections we use background process – replication (=sync). Schedule for the sync depends on the actual store: UNC servers / local machine replicate every 30 sec, but for SharePoint it's by default set to 10 min. If replication fails (e.g. because the machine has lost power) the cache will still have the data and will try to replicate again after OneNote is restarted.
    4. Actual mechanics of the incremental save are rather technical. The bottom line is that we have our own binary format and all changes are stored in form of "revisions", sort of diff between current state and previously saved state. As these revisions grow OneNote will run optimization to clean up the revisions and update the main base state.


    Hope it clears things a bit, let me know if you have any questions.

    Thanks Irina! So I hope this explains things like why we have a cache (which allows OneNote to go offline, merge changes and more) as well as explain why our app works certain ways. The storage tech is actually quite complex and innovative; I haven't really appreciated it as much until I deal with other sync technologies that make me choose which copy is the most up-to-date, etc. There is still a lot more going on under the covers but this is a good overview, if you have more questions please let us know.

  • Engineering OneNote Blog

    How to create outlines with ink


    Alex Simmons on the OneNote PM team wanted me to post this for him. Have you wanted to create outlines while inking in OneNote? Well with Alex's handy tips you can:

    Also, let me add a little to the list below too:

    • Always start paragraphs with an ink bullet (or inked numbering)
    • Draw your bullets as a circle, then fill in the circle all in one stroke, like filling in a bubble on a scantron test
    • If your paragraph has multiple lines, on the 2nd and following lines, make sure the beginning of the text on the left side matches up with the left most text on the first line, and that the bullets on the same level are aligned vertically.
    • Make sure the spacing between the bullet/number and your first word is consistent.
    • When you indent, also use bullets
    • When you indent, indent a distance that is between 1-2 line heights (the space between the rule lines is one line height) in – this isn't a hard limit, it will just look less ambiguous to the ink parser
    • When you want to move structure around, switch to selection mode, and use the paragraph handles to move your paragraphs around.  By default, this will move a paragraph's sub-paragraphs with it.
    • If you want OneNote to know that you want to start a new outline, draw a horizontal line across your page, and make sure it is wider than the outline above it.
    • If you think OneNote has done something unpredictable in the way it has created some structure, try lasso'ing all or part of the ink on the page, and moving it slightly.  This will cause that ink to be reparsed with the rest of the ink on the page.


    These are not hard rules, just guidelines. You may find success or failure using slight variations of the guidelines above.  You'll notice that even though in my example I followed the guidelines pretty closely, the resulting structure still isn't exactly perfect (separate paragraph for "line heights."):

    This will allow you to convert to text and it will preserve the paragraph positioning as well as the bullets. Thanks a bunch Alex!

  • Engineering OneNote Blog

    Joshua Flanagan’s FlexWiki-->OneNote


    It looks like Joshua has been at it again, fresh off his OneNote DevPal release he has posted his own FlexWiki to OneNote tool! You can read about it here: Migrate from FlexWiki to OneNote

    Here are some excerpts:

    Then Microsoft OneNote 2007 was released, sporting a new "shared notebook" feature. With OneNote, you get the same ease of access and ease of editing that a wiki provides, but with a much smoother experience. To mirror the history log functionality of a wiki, you can store your shared notebook in a versioned SharePoint document library. The only disadvantage of OneNote compared to a wiki is the requirement for all of your users to have OneNote. If that requirement is already met, I believe OneNote is a far superior experience. OneNote advantages at a glance:

    • Easier editing. Toolbar buttons and shortcut keys instead of funky markup syntax to learn. No need to switch to "edit mode".
    • Richer formatting. Text can be many styles, sizes, colors. Screenshots and other images can be easily pasted inline. Documents and audio clips can be attached to a page.
    • Easier searching. Searches find words in any page text, image, or audio clip!
    • Offline access. All data is synchronized to your local machine when you are connected to the network, so you can access it when you are disconnected. Any edits you (or others) make are automatically synchronized to and from the shared location when you reconnect.

    My team was sold on the benefits, but we had a sizable investment in our existing FlexWiki installation. Thankfully, OneNote has a nice API that makes it easy to get data in and out. I was able to put together an application that migrated our entire wiki to a OneNote notebook, with all formatting and hyperlinks intact.

    Command-line syntax:

    wiki2one <wikiRoot> [Notebook] [SectionName]

    wikiRoot is the full path to the directory containing your *.wiki files. This is the only required parameter.

    Notebook can be either just a name or a full path to a Notebook folder. If the notebook does not exist, it will be created. If a path is not provided, it will be created in the same location as your first existing notebook. If a value is not specified, the default is Wiki2One.

    SectionName is the name of the OneNote section that will contain the migrated pages. If it does not exist, it will be created. If not specified, a default is generated based on the current time.

    Note that all pages are imported into a single OneNote section. It is very easy (and highly recommended) to then organize the pages into logical sections once the migration is complete.

    If you make improvements to the code, let me know, and I'd be happy to host it, or link to it from this post.

    Download the source code

    Download the executable (requires the .NET Framework 2.0 runtime)

    What I love is that you can download the source yourself and modify it accordingly. Nice work Joshua and please keep up the great work! For everyone else if you modify this code please let me and Joshua know.

  • Engineering OneNote Blog

    Crabby Office Lady: Crabby sings the praises of OneNote 2007


    The Crabby Office Lady just wrote up something on OneNote 2007: Crabby sings the praises of OneNote 2007.

    Very cool! Thank you Annik Stahl!

  • Engineering OneNote Blog

    Follow-up to WebDAV support with OneNote 2007


    I saw this on the OneNote newsgroup and I wanted to pass it on:

    Subject: OneNote + WebDAV Update

    Given the interest in the area, I  wanted to set the story straight (so far)
    for hosting OneNote notebooks on plain WebDAV servers.

    This does NOT apply to SharePoint.

    For clients running Windows XP
    Unfortunately in XP, OneNote notebooks on plain WebDAV servers won't be
    supported. The reason being XP issues unauthenticated OPTIONS, PROPFIND, and
    MOVE WebDAV requests even when the client is authenticated. Because these
    requests fail on secured DAV servers, OneNote fails to sync.

    If you insist, there is an UNSUPPORTED work around to enable this scenario.
    To do this, enable unauthenticated OPTIONS and PROPFIND requests on your DAV
    server. Please do not, I repeat, DO NOT, allow unauthenticated MOVE requests
    for security reasons. This allows XP OneNote clients to host notebooks on a
    plain DAV server, but won't be able to rename or move sections.

    To do this on Apache, edit httpd.conf to allow unauthenticated access for
    PROPFIND and OPTIONS requests to the notebook.
    For example, it may look like this:

    <LimitExcept OPTIONS PROPFIND>
    AuthType Digest
    AuthName DAV
    AuthUserFile conf/digest.passwd
    require valid-user

    For Clients Running Vista
    In Vista, accessing WebDAV with basic authentication over non-SSL servers is
    flat out not allowed. That's because we don't ever want to send your
    login/password in plain text through the wire.

    For all other WebDAV servers, OneNote notebooks on WebDAV servers should be
    supported in Vista. However, we've hit some issues that prevent this from
    working and we're working with the Windows WebDAV team to fix that up. Stay
    tuned for an update on this soon...

    Hope this helps,

    David Tse[MS]


    Thanks a bunch Dave!

  • Engineering OneNote Blog

    Sort Pages powertoy


    Here is another powertoy that I wrote that I wanted to share with you all. What does it do? It will sort any section's pages into alphabetical order, like this:




    1. You need to have OneNote 2007 + the .Net Framework 2.0 installed on your machine
    2. Download the file here: OneNote2007SortPages.zip
    3. Install it!
    4. Close and restart OneNote
    5. You will now have a new toolbar button that you can click which will sort the currently viewed section's pages. The button looks like this:


    1. There is NO UNDO! Once you click that button it will sort the pages and you cannot revert the changes so be careful.
    2. You can only sort A-Z, there are no other options.
    3. It sorts by whatever order the .Net Framework believes is correct for your locale. For example sorting in Japanese does not sort by phonetic sounds like it does in Excel (and other Office apps).
    4. For large sections performance isn't the best, just let it finish and it will eventually get there.
    5. There is no prompt before sorting the pages

    As you can see there is still some work that could be done with this but I just didn't have the time. I hope to post the code soon and then anyone can take it, add whatever options they want and make it a whole lot better.

    I wanted to thank Kazuko Hishikawa, a Tester on the OneNote team, for helping me out and finding all of the issues that I just didn't have time to work out : ) Thanks Kazuko!

    Please let me know what you think, I am just excited that I can point this out to my mom since she really wants this feature. If you have problems or questions please let me know in the comments.

  • Engineering OneNote Blog

    Keyboard shortcut: goto first/last page in a section


    I just discovered this shortcut the other day and I wanted to blog about it:

        Alt+Home/End – Takes you to the first/last page in a section

    I wasn't sure if this was documented before but I thought it was great and I wanted to pass it on. Have a great weekend all!

  • Engineering OneNote Blog

    Add OneNote 2007 Printer as Right-click Send To option


    I just saw that Rob Bushway over on the GottaBeMobile site posted these great directions:

    So, I went off on a goose chase to figure out how I could easily add a OneNote 2007 printer as a Send-To option, and I figured it out! Having this option will allow you to right click any printable file, go to the Send To option, and choose the OneNote 2007 Printer.

    1. Navigate to your c:, then go to Tools / Folder Options / View. Turn off the checkmark to hide hidden operating system files. I recommend turning this back on when you are finished. I currently have User Access Control turned off and am the administrator of my machine, so I'm not sure what rights issues you could run in to.

    Ed Holloway has made a suggestion for those with UAC turned on:

    Users with UAC on may have trouble with steps 1&2.

    Step 1 can be deleted, and step 2 replaced with Start\Search(Run)\shell:Sendto this will open up the correct Send To folder ( C:\Users\[UserID]\AppData\Roaming\Microsoft\Windows\SendTo\ ), as opposed to the link at C:\users\%your profile name%\

    2. After  setting that option, Go to c:\users\%your profile name% . You should see a short cut called Send To. Windows XP users will find this under c:\documents and settings\%profile name%

    3. Leaving that window open, go to Control Panel / Printer.

    4. Activate both the window containing your c: and the printers so they are side by side. Then, drag the Send To OneNote 2007 printer and lay it across the Send To short cut.

     5. All finished. Now your Send To OneNote 2007 printer will be a right click Send To option.  This should work with all printers and any document you want to print.

    Read all about it here: GBM How-To: Add OneNote 2007 Printer as Right-click Send To option. Nice work Rob!

  • Engineering OneNote Blog

    Send to OneNote 2007 powertoy


    Finally a powertoy that I wrote! This is a small application that I blogged about before where I included the source and rest of the application, but here is the final version of this Send to OneNote from Windows Explorer. Here are the steps to get to a machine near you:

    1. Install OneNote 2007 + .Net Framework 2.0
    2. Download the installer from here: SendtoOneNote2007.zip
    3. Install it!

    Now when you right-click on a file in Windows Explorer you will see a new option under the "Send To" menu for OneNote 2007 like this:

    Choosing that option will send the file to OneNote as a new page in the Unfiled Notes section, like this:



    1. You can send more than one file all to the same page.
    2. You cannot send folders.
    3. If you select folders + files the files will go into OneNote however the folder will not, you won't get an error about this.
    4. If your Unfiled Notes section is password protected or read only you will get an error message that isn't too pretty.
    5. You cannot change the destination section, it will always go to the Unfiled Notes section

    Download now: SendtoOneNote2007.zip

    If you would like to improve anything please go ahead and download the source and modify it as you see fit!

    Also a special thanks to Michelle Wong from the Test team who helped find bugs and test our my powertoy, *tips hat*

    If you have problems/questions please use the comments below to chat with me.

  • Engineering OneNote Blog

    OneNote and PowerShell


    I was reading The Unknown OneNote Guy's Blog and also the OneNote PowerToys site which featured a post written by the Unknown OneNote Guy. He writes about how to use PowerShell and it's built in commands to perform a 'send to OneNote' from anywhere in the shell. So imagine you are doing a bunch of work and you wanted to output it you could do with OneNote with the pipe command, |, which is one of my favorite redirects. Read all about it here: PowerNote Send To OneNote 2007.


  • Engineering OneNote Blog

    Export your Outlook notes to OneNote


    What a busy day! I just heard from another Tester John Guin that he has another OneNote powertoy available. This one will export all of your Outlook Notes to OneNote with one click of the button. If you have been wanting to migrate your notes here is the time!

    Download now: ExportOutlookNotestoOneNote.zip


    1. You will need .Net Framework 2.0 installed
    2. Run setup.exe
    3. Close and restart Outlook
    4. You will now see this button when you are in the Outlook Notes module:

      Just click on Export To OneNote

    5. You will then see this:

    6. Now check your Unfiled Notes section and your notes will be there!

    Download now: ExportOutlookNotestoOneNote.zip

    Nice work John! If you have problems/questions please let us know in the comments below.

  • Engineering OneNote Blog

    OneNote 2007 Word Count


    Here is another powertoy from the OneNote team, think of it as some love from the OneNote team on Valentine's Day. Jeff Cardon from the OneNote Test team wrote this powertoy which will count the number of words you have on a page, just by the click of the button. Here is what you should do:

    1. You need to have the .Net 2.0 Framework installed
    2. Download the application from here: OneNote2007WordCount.zip
    3. Run setup
    4. Close and restart OneNote
    5. Look for this in the toolbar:

    1. Click the button!

    This will launch the following app which counts the number of words on the page, title, ink and more! Just like this:

    Download now: OneNote2007WordCount.zip

    Now you can get a word count in OneNote, nice work Jeff! If any of you have problems or questions please let us know by leaving feedback below.

  • Engineering OneNote Blog

    Couple OneNote 2007 Reviews


    I just saw that there have been a couple reviews of OneNote 2007 that just came out. The first is from Paul Thurrott and his SuperSite for Windows. You can see the review here: Microsoft Office 2007 Review Part 3: Office 2007 Applications. Here are some of his comments:

    And as fans of the previous versions of OneNote (2003 and 2003 SP1, the latter of which was a major upgrade) might expect, OneNote 2007 is a winner.

    What we do get this time around is a bunch of evolutionary improvements that make OneNote feel like a much more mature application.

    As implied above, OneNote now supports multiple notebooks (finally). This allows for further levels of organizational opportunities and frees users from the folder-based organizational scheme required by previous versions.

    OneNote picks up the Instant Search functionality from Outlook. I've never been a huge fan of the way OneNote searches, but at least now it's quick, and you can search across multiple notebooks.

    I was in love with OneNote the second I saw it, but as a heavy user, I've also developed a wish list of needed features. Some have been answered in this release (while others, like notebook locking, which could prevent future edits or deletes to archive notes, have not). One is in-note hyperlinks that link to notes elsewhere, be they in other notebooks or folders, other drives, or PCs, or Web locations. OneNote 2007 adds this useful feature, allowing you to logically jump around notes in a way that's been available in hypermedia solutions since the late 1980s. Back and Forward buttons in the Standard toolbar work just like those in a Web browser.

    The second is a review from Simon Jones from the PC Authority (Australia) and his review is here: Microsoft OneNote 2007 here are some comments from this review:

    OneNote is a misunderstood application. Although some people think it will only work on a tablet PC, this is far from true. OneNote will work equally well on a desktop PC, notebook or a tablet. There's even a pocket version for use on Windows Mobile devices.

    At its heart, OneNote is a place where you make notes, scribble diagrams and gather information. It's quick and easy to jot things down, paste stuff in from the Internet or other applications, then drag it all around and share it with other people. If you do run OneNote on a tablet PC, you get the added advantage of being able to handwrite notes and later have them converted to text.

    If you store a OneNote notebook in a SharePoint document library or network share, all of its contents are available to anyone with access to that document library or share. Email someone a link to that notebook and they can synchronise their copy of OneNote with the shared notebook. They can then make changes, such as adding, editing or deleting text, graphics, pages or sections, whether they're online or offline. Any changes they make while offline will be replicated on the server copy next time they connect, and OneNote will automatically resolve most conflicts by itself. If you don't have a central server, you can share a notebook directly from your PC.

    OneNote is a fantastic application that deserves wider attention. It's now included in the Home & Student, Enterprise and Ultimate editions of Office, but users of the other editions should seriously consider buying it as a separate application.

    And one last thing from Simon's review:

  • Engineering OneNote Blog

    OneNote DevPal – Another tool to help devs working w/OneNote


    I just read an email from Joshua Flanagan where he pointed me to another tool to help developers working with OneNote 2007's API. It is called OneNote DevPal. It is another tool to help people working with the API please see here:


    • Display the contents of the current page, in XML form. Changing the page in OneNote will auto-update the XML in DevPal. It does not yet auto-refresh the current page if you make changes in OneNote, but you can get the same effect by navigating away, and then back to your original page.
    • Display the current hierarchy in XML form. Changing the current page in OneNote will auto-scroll the hierarchy XML so that the current node is displayed at the top.
    • Both XML displays are syntax highlighted specifically for OneNote XML (OneNote start tags, "ID" and "name" attributes, and CDATA text are emphasized)
    • Displays the level, name, and object ID for the current page, and each of its parent containers, all the way up (Page, Section, SectionGroup, Notebook)
    • Records all events raised by OneNote to the standard debug output. By running a tool like DebugView while using OneNote with DevPal, you can better understand what and when events get raised by the add-in API.

    So please use this with OMSpy the two of these tools will really help anyone working with the API: OneNote DevPal. Nice work Joshua and thanks for telling me about it!

  • Engineering OneNote Blog

    OMSpy - A OneNote developer’s tool


    I know a few people have created their own app which does this but I finally wanted to release the one that Ilya Koulchin created for us on the OneNote team. Introducing..OMSpy

    OMSpy Overview

    OMSpy is a tool to get you started using the OneNote API, it allows you to export the XML for an entire OneNote hierarchy, sections & pages. It also lets you update the hierarchy with one click of a button. Additionally you can update the page content and see if you edits are valid before updating them on a page.




    1. Refresh – This will refresh the current hierarchy of what you see in the view
    2. Release – This will release OMSpy's COM reference to OneNote
    3. Get Content – If you have an item selected this will give you the XML for the content. This is mainly useful for the pages
    4. Update Content – If you make changes in the content field it will update the XML accordingly and make a change on the page.
    5. Publish PDF – This will publish a PDF for the current item selected, via the API
    6. Save Archive – This will create a OneNote Package (onepkg file) for the item selected
    7. New Page – This will create a new page in the section selected
    8. Navigate To – This will launch OneNote and navigate to the item selected
    9. Update Properties – This will update the page's properties as listed under the main content
    10. Exit – Well I think you can understand this one

    All you need to do is to download OMSpy.zip and extract it wherever you want, make sure you have OneNote 2007 installed and then you are done! I believe it needs the .net 2.0 framework.

    Download: OMSpy.zip

    If you have problems please let us know. <applause> Otherwise a big thanks to Ilya for his help on this! <applause>

  • Engineering OneNote Blog

    Another favorite shortcut: Ctrl-G


    I am a keyboard fan, I detest using the mouse and I always try and key my hands @ the home keys @ all points since it is so much faster. That being said I wanted to mention on my favourite shortcut keys: Ctrl-G which brings focus to the navigation bar in OneNote (that thing on the far left hand side). Many times I will want to move from my general work notebook (my 1st notebook open) to the OneNote 14 planning notebook (the 4th notebook I have open). Most people would get the mouse and click on the notebook and then click around some more. I will just hit Ctrl-G, down arrow a few time and then enter.

    It works great!

  • Engineering OneNote Blog

    OneNote 2007 Screencasts - Thanks to Erik


    I just got an email from Erik announcing that he had some screencasts teaching OneNote 2007. I met Erik through the beta program for Office 2007, during the beta Erik was one of our most active bug submitters and even sent me a few gigs worth of his student notes. Even more impressive he got pretty much his whole school running OneNote and getting more of his students more productive and engaged. So anyhow he told me that he got some screencasts up on his website for all to see:


    I just visited the site and I like what is up there. I think he could do another few casts on the following:

    1. How do I organize my notebook? What should be a notebook and what should be a section. How do I organize pages and subpages?
    2. Taking audio notes in a class
    3. Erik's favorite features & tips

    Just a few thoughts I had, but otherwise thanks a bunch Erik…I will be sending these to my mom so you can check them out.

  • Engineering OneNote Blog

    PowerToy: Outlook To OneNote AddIn


    John Guin a new Test Lead on our team wrote up this great tool which will take messages from Outlook and create a new OneNote note for them. Here is the description:

    This addin adds the capability of sending yourself email with a certain keyword in the subject and having Outlook automatically create a new page in OneNote's Unfiled Notes section when that mail item arrives. Outlook then deletes the email. It also allows power users to set the filter used for incoming mail items to trigger the code. It provides no UI for the user: "it just works."

    What more can you ask for? You can download the setup.exe as well as the source code all over @ the Code Project: Outlook To OneNote AddIn. Nice work John!!

    Update @ 2/9/2007 2:39 AM: I just heard from John that the Code Project strips out apps which have setup.exe in their name. I have posted the setup files here: OutlookToOneNoteAddinSetup.zip. That should work for you now!

  • Engineering OneNote Blog

    Creating a C/C++ Add-In which works with OneNote!


    I thought I would take some time today and write up how to program a C/C++ add-in that works with OneNote 2007. Here are the directions I had and downloads below.

    1. Open Visual Studio and create a new C++ project.
    2. For my example I am creating a Win32 Console App:

    3. Now I want to add the OneNote2007 header file, OneNote12.h. You can find that attached with this document. Make sure to copy it to the folder with your C++ source files as well as add it to your header files like this:

    4. Add a new #include for OneNote:

      #include "OneNote12.h"

    5. Now just connect to OneNote like you would any other COM API. Please see here for an example:


          IApplication* piOneNote;


          CoCreateInstance(__uuidof(Application), NULL,

              CLSCTX_LOCAL_SERVER, __uuidof(IApplication), (void**)&piOneNote);




              BSTR temp;        

              HRESULT hr = piOneNote->GetHierarchy(NULL, hsNotebooks, &temp);

              wprintf(L"%s", temp);


    A huge thanks to Ilya Koulchin for his help with this, I couldn't have done this without you!


    This should be all that you need to get this working, but if you need anything please let us know!

  • Engineering OneNote Blog

    Note taking tips from Lifehacker


    I saw this the other day on Lifehacker and I wanted to pass it on:



Page 1 of 2 (27 items) 12