June, 2007

Search
  • Engineering OneNote Blog

    OneNote Search and Replace

    • 61 Comments

    It is Friday evening after a nice long busy week and I got permission to release another powertoy!  This powertoy is the OneNote Search and Replace feature so please check it out.  I know a few people have asked for this on the newsgroup as well as via the comments section.  Perfect for when code names change (think Longhorn-->Vista).  This powertoy was written by an superstar OneNote developer so a big round of applause for Jeffrey; thank you much for coding this and letting me release this.

    How it works

    1. Download the application from here: OneNoteSearchReplace.zip
    2. Extract the application and run the setup.exe
    3. You will now have a new toolbar button in OneNote which looks like this:
      image
    4. Click the button and you will see a window like this:
       image
    5. Now you can choose your search terms and what scope.
    6. Click Preview and Replace to try it out!

    Remember all powertoys available from this blog are AS IS and are not supported by Microsoft. 

    Please use at your own risk, but please do enjoy!  Have a great weekend all!

  • Engineering OneNote Blog

    Matlab to OneNote - Thanks to Stephen Lawrence

    • 11 Comments

    I just got an email from Stephen Lawrence who shared with me a Matlab app/script which will publish to OneNote.  For example say you have the following in Matalb:

    fprintf('Hello World\n');
    figure;
    plot(magic(10));

    And then you wanted to publish it to OneNote, you can with just this one command:

    OneNotePublish('test.m');

    Steve explains it all here:

    I took your Send file to OneNote powertoy code and adapted it for Matlab. I have attached my code below so that you can get an idea of how it works.

    I had to switch from creating Matlab XML to Matlab HTML...the result works well. All I had to do to publish my file in OneNote was type:

       OneNotePublish('test.m');

    in the command window.I got the resulting page:

    image

    You can download the source for this by downloading it here: Matlab2OneNote.  Nice work Steve!  Thanks a bunch for telling me about it!

  • Engineering OneNote Blog

    Tagging & todo lists, GTD with OneNote

    • 3 Comments

    I just saw the following post by Ralf Scharnetzki who posted a nice long article on Tagging in Microsoft's OneNote enables seamless maintenance of ToDo lists.  Pretty cool, check it out!

  • Engineering OneNote Blog

    Jeremy Lewi's Send to OneNote powertoy

    • 1 Comments

    Jeremy Lewi from Georgia Tech has the following powertoy available on his site: SendtoOneNote

    Overview: This addin provides a program to create links to files on OneNote pages. Shortcuts are created in the SendTo folder. This allows files to be sent to OneNote by right clicking on them and selecting SendTo. Two links are created which allow the sent files to be added to the current page or a new page.  If the file is an XML file, an XSL transform is applied which outputs OneNote xml which is then incorporated into the current page.

     

    This program was originally based on Daniel Escapa's sendToOne powertoy. However, instead of embedding the files in OneNote it creates a link. It also automatically applies an XSLT transform to any XML files you send.

     

    Download:

    Source code

    Setup

    Looks like an interesting project, if you are interested please check it out!  Nice work Jeremy

  • Engineering OneNote Blog

    Firefox Clip to OneNote powertoy updated!

    • 1 Comments

    There have been lots of people asking about the Firefox Clip to OneNote extension that was written over a year ago but only worked with Firefox 1.5.  It is pretty easy to update the extension, you just open the XPI file and look at the install.rdf and you change the MaxVersion to something higher.  Well I could never do this since I didn't write the powertoy and I didn't have permission from the author.

    Well it looks like Patrick just went ahead and updated the extension and posted it to his blog!  You can read about it here: “Clip to OneNote” Firefox Extension.

    Thanks a bunch Patrick, hope things are going well in Deutschland.

  • Engineering OneNote Blog

    Make current page a subpage

    • 8 Comments

    Yesterday I went through the OneNote Newsgroup and I saw this question about making a page a subpage: Make a page a subpage

    There were lots of good responses and Josh Einstein (of OneNote Calendar fame) mentioned that he should write a powertoy which does this.  I replied saying that I should do something like this as a fun afternoon project.  Well I am happy to say that I did just write something up and I will be sharing the code with you all.  However I don't think I should release a full powertoy for this.  You want to know why?  Here's why:

    1. For most people it is easier to just use the group command to group pages together.  If you have a page you want to make a subpage then select that page and the page above, right-click and choose group.
    2. If you use this code it will create a subpage but if you try dragging it elsewhere it will not keep the subpage-ness, so that isn't too helpful.
    3. Not that many people know about these powertoys posted on blogs.

    Anyhow I did want to share this information on how to write this code and give it to you all:

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Xml;
    using OneNote = Microsoft.Office.Interop.OneNote;
    
    namespace MakeSubpageGuts
    {
        class Program
        {
            private string strNamespace = "http://schemas.microsoft.com/office/onenote/2007/onenote";
            private OneNote.Application onApp;
    
            static void Main(string[] args)
            {
                Program p = new Program();
                p.run();
            }
    
            public void run()
            {
                //create an instanace of OneNote
                onApp = new Microsoft.Office.Interop.OneNote.Application();
                //get the currently viewed page id
                string cur_page_id = findCurrentlyViewedPage();
                //Get the section XML based on the currently viewed page
                string cur_section_xml = getXMLforSection(cur_page_id);
                //Change the section XML so the currently viewed page would a subpage
                string resulting_xml_to_update_for_subpage = parseXMLMakePageSubPage(cur_section_xml, cur_page_id);
                //update OneNote
                updateOneNoteContent(resulting_xml_to_update_for_subpage);
    
            }
    
            private void updateOneNoteContent(string in_xml)
            {
                try
                {
                    onApp.UpdateHierarchy(in_xml);
                }
                catch (Exception e)
                {
                    showError(e);
                }
            }
            
            private string parseXMLMakePageSubPage(string in_section_xml, string cur_page_id)
            {
                //basic XML Doc stuff
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(in_section_xml);
                XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);
                nsmgr.AddNamespace("one", strNamespace);
    
                //find the currently viewed page
                XmlNode pagetoMove = xmlDoc.SelectSingleNode("//one:Page[@ID=\"" + cur_page_id + "\"]", nsmgr);
                //create a new XmlNode for the isSubPage property on pages
                XmlNode subPageAttr = xmlDoc.CreateNode(XmlNodeType.Attribute, "isSubPage", xmlDoc.NamespaceURI);
                //set the value to true
                subPageAttr.Value = "true";
                //add that to the Page node XML
                pagetoMove.Attributes.SetNamedItem(subPageAttr);
                //return the XML back to the calling method
                return xmlDoc.InnerXml;
            }
    
            private string getXMLforSection(string in_cur_page_id)
            {
                string sectionID = "";
                try
                {
                    onApp.GetHierarchyParent(in_cur_page_id, out sectionID);
                }
                catch (Exception e)
                {
                    showError(e);
                }
    
                string sectionXML = "";
    
                try
                {
                    onApp.GetHierarchy(sectionID, Microsoft.Office.Interop.OneNote.HierarchyScope.hsPages, out sectionXML);
                }
                catch (Exception e)
                {
                    showError(e);
                }
    
                return sectionXML;
            }
    
            private void showError(Exception e)
            {
                Console.WriteLine(e.Message);
                System.Environment.Exit(-99);
            }
    
            private string findCurrentlyViewedPage()
            {
                string strXML = "";
                                       
                try
                {
                    //Get the hierarchy from the root to pages
                    onApp.GetHierarchy(null, OneNote.HierarchyScope.hsPages, out strXML);
                }
                catch (Exception e)
                {
                    showError(e);
                }
    
                //Basic XML Doc stuff
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(strXML);
                XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);
                nsmgr.AddNamespace("one", strNamespace);
    
                // Find the page ID of the active page
                XmlElement xmlActivePage = (XmlElement)xmlDoc.SelectSingleNode("//one:Page[@isCurrentlyViewed=\"true\"]", nsmgr);
                return (xmlActivePage.GetAttribute("ID"));
            }
        }
    }
    

     

    Take care...also I tip my hat to DStockwell who wrote the Paste from Visual Studio plugin for Windows Live Writer; you can download it here: Paste from Visual Studio.

  • Engineering OneNote Blog

    Information on OneNote Misplaced Sections

    • 15 Comments

    I saw someone ask about Misplaced Sections on the OneNote newsgroup so I thought I would blog about this.

    1. Misplaced Sections are created whenever OneNote could not sync some changes from the local cache to the master copy of the file. This might happen if you make some changes offline, then delete the master .one file and then come online; OneNote will move that section to the misplaced sections. You might also see this if you make changes to some notebook and while offline you try and close the notebook. OneNote will prompt you if you are sure you want to do this and if you choose to do so OneNote will create a Misplaced Sections virtual notebook and store the changed sections in there.
      The main point here is that OneNote will not delete changes to your content, we want to be very conservative with your content and lose it.
    2. Misplaced sections are only in the cache. These misplaced sections are not in the file system, you can only get to them from the cache and by running OneNote.
    3. They work like other sections so you can move them to other locations or deleted them; but they are read-only while they are in the Misplaced Sections notebook. If you have lots of misplaced sections and you want to quickly clear them out you can navigate to one of the sections and then choose File-->Delete all Misplaced Sections.
    4. If you reopen the notebook in question OneNote will attempt to patch up problems and move the misplaced sections out of that virtual notebook and move them to the master copy of the file. It works magically in certain cases, I was really impressed when I saw this working well.

    If you have more questions please let me know and I will add to this.  Ideally you should never see misplaced sections : )

  • Engineering OneNote Blog

    Send to Mobile Device - John Guin and I working together

    • 14 Comments

    I wanted to post about a new powertoy that John Guin and I worked on called "Send to mobile device".  Interesting story with this powertoy.  I wrote this powertoy back in October/November back when we shipped and I had some free time.  I didn't get a chance to clean it all up but the guts of the app worked just fine.  I used it on my personal machine to sync notes with my OneNote Mobile device.

    Fast forward to a couple weeks ago when John came to my office asking what it would be like to create a powertoy which did this.  John had some new ideas like keeping a particular page in sync and not creating extra copies on the device.  I sent him my code and he got something working.  He fixed up a bug I had with my copy code and then he also added his extra functionality.  You can read John's version of this here: Making pages easier to sync with a mobile device.

    Links to the downloads:

    Setup files

    Code (C#)

    Thanks a bunch to John for his help with this and getting this code to see the light of day!

  • Engineering OneNote Blog

    End of just 'filers' and 'pilers'; we are both!

    • 3 Comments

    I am writing today but I wanted to share a conservation we had at lunch the other day which was about filers and pilers.  Yes this is what happens when you bring a bunch of OneNote PMs together for lunch we often end up talking about work related issues.  Anyhow the filers versus pilers discussion has been going on for a long time and many people on the team though that a person was one or another.  I want to dispel that myth.

     

    First let me explain what filers and pilers actually are by using the example of how someone organizes their email.  I know many of you get lots of email in a way and managing it is always a challenge and I want you to take a step back and think about your inbox.  Do you just have every email over the past few years in your inbox and you have thousands of emails in there.  These people are typically pilers, they will just pile all of their information together since that is easier than organizing it.  Pilers typically will rely on search to find their information or they don't mind hunting and pecking every once in awhile.  Then there are people who organize a lot of their email by dropping emails into separate folders per topic or idea.  These people, filers, will file all of their information into the appropriate bucket.  Later when they are looking for something they will look in that folder and they will find just what they are looking for.

     

    We think of OneNote users in the same vein and we consider our users in buckets of filers and pilers.  When I talk with people who use OneNote it is always interesting to see how many notes they have and how they organize their notebook.  Do they have a giant Unfiled Notes section?  I know some people who just keep adding to that one section and have hundreds of pages in there.  Then there are other users who have a lot of notebooks and they file everything accordingly.  I personally always thought that deep down we are all filers, but we are also lazy and we don't want to take the time to file so instead we pile since that is easier.  When we have 'free time' we will take our piles and we will file them, at least that is how I often handle things.  Interestingly you can tell how on top of things by two measurements: how many pages I have in my unfiled notes (right now only 13 so I am doing well) and how many items I have in my inbox (right now 43) so you can see I am doing really well.  A couple of weeks ago this was very different.

     

    So on the team when we talk about features we think about their investment level based on how our users will use the feature.  Will this be something that is used by everyone or will only a small percentage of users actually use this feature and therefore how do we balance what we do based on these user scenarios.  Search & note tags have always been something we have invested heavily in for those people who pile, we want to help people get to their information later.  The organization & navigation (notebooks, section tabs, & page tabs) as well as drag & drop have always been for those people who are filers; we need to help them get their notes in the correct location.  I think in some conservations it was thought that OneNote users' habits were a binary switch, they were either a filer or a piler and I think that is wrong.

     

    People are both filers and pilers and who they are depends on in what scenario they are using OneNote.  You aren't just a filer or a piler but instead your behaviour is governed by how you are using OneNote.  If you are using OneNote by yourself you might be a filer or a piler, this depends on your own personal experience and preference.  But when people use OneNote in shared settings (like shared notebooks) they typically are filers.  Think about it if you are working with others and you cannot effectively work with them unless you have some filing system or shared notebook that is in order.  There needs to be some method to the madness and organization structure for this shared notebook; without this you will have chaos and people will not use the shared notebook.

     

    We have found that as people start to share their notes more and use notebooks with other people they come up with some organizational structure that works well for the task at hand.  People will often have sections organized in a particular way, they will use subpages to group related groups of pages and they will continue to use this system for all new notes that are created.  In their personal notes they might be a piler but in a shared space it is vital that everyone is a filer and work in this notebook structure.  Think about if at your company the filing cabinet didn't have any organization it would be a mess and it would fail to be useful.  The fact that there is a system and an organize structure is what makes this work; your own filing cabinet can be a mess (since you know the system) but if you are working with others this just doesn't work.

     

    This post was more of something I wanted to write for the team than just for my blog.  We need to not think of people are just filers or pilers but as both.  They will use both sets of tools to get their work done in OneNote.  In their personal & shared notebooks they will use search, drag & drop, subpages and tags.

  • Engineering OneNote Blog

    Interesting sync problem - "Sync to a new location"

    • 5 Comments

    We have a mailing list for all of the OneNote MVPs as well as some people on the OneNote team.  Just the other day Patrick wrote us with this problem:

    That particular notebook is stored on my desktop and available to use on my desktop, my tablet and my girlfriend’s laptop. Right now though, my desktop is sitting in a shipping container in a US port waiting for the ship to take it to Germany while its hard drives went over the Atlantic in my carry on luggage.

    When I got to Germany, I realized that our notebook would not sync anymore because the server containing the notebook (my desktop) was not there. Considering that this is the notebook we use for our move, keeping it in sync is very important right now. (link)

    So the problem was that they both had a copy of the notebook and they both contained changes.  How could you get them back in sync without needing to manually go through the changes and merge things yourself?  Is there a way to do this?

    Well I wasn't 100% sure so I suggested the following to Patrick:

      1. Find a USB key
      2. On you Tablet right-click on the notebook and choose properties
      3. Choose to sync the notebook to a new location, and have it saved to the USB key
      4. Try the same on the other machine

    Amazingly this worked without any problem!  I wasn't sure if we fully supported this scenario but I guess we did which is amazing!  You can read all about it here: OneNote 2007: Switch notebook from client-server sync to peer-to-peer sync while offline

    Nice job OneNote team!  I wasn't involved with this but it is just awesome, hopefully this will help other out there.

    Update @ 6/7/2007, 11:32 PM from Ilya Koulchin a developer on the OneNote team:

    Yep, this is a neat feature. The only caution I'd make is about moving the notebook back to the desktop once that computer comes back online. If you just use the "move to new location" feature again to point at the desktop, you'll likely lose some of your more recent notes. Instead, first, you should DELETE the copy of the notebook on the desktop, then use the "sync to new location" from one of the laptops to publish a more recent copy of the notebook to the desktop from scratch. Then you can boot OneNote on the desktop to sync to the updated version of the notebook. This workaround is needed since the feature was designed for permanent moves of notebooks, not temporary relocations (I'm assuming Patrick doesn't want to keep all his notes on the USB stick forever!). If there's more interest, I can have Dan post a proper post about why all of this is necessary.

  • Engineering OneNote Blog

    May OneNote Blogging round-up

    • 1 Comments

    Here is another month's worth of community comments!  Please keep them coming and thanks!

    1. My school gave out Office 2007 to everyone for free. It came with this program called OneNote, and now I'm addicted.
    2. "It is a triumph, and one of the company's finest products."
    3. Why I'm addicted to OneNote.  I've used OneNote since Friday and already I'm addicted
    4. Lo and behold, best thing ever. OneNote is my new best friend
    5. This leads me onto my now-favourite-application OneNote. This app is stunning, it blew myself and colleagues away
    6. OneNote Rocks - what's killer are the sharing capabilities
    7. Microsoft One’f*ckin’Note is the future!
    8. I want to start a family with my new love: Microsoft OneNote 2007
    9. I was impressed that one cohesive package Just Worked. To me, it's a prime example of where Microsoft should be focusing its energies
    10. give OneNote a try. I dismissed it once as overkill, but now I believe this is a product that deserves its "wow".
    11. OneNote Is The Answer
    12. More OneNote lovin'
    13. Microsoft has produced a fairly good product: OneNote. There are a few kinks, but for the most part, I see the program as having huge potential for keeping me organized.
    14. I live in OneNote 24/7 on my Tablet PC.  It's the first program I fire up each morning
    15. I Don't Understand OneNote
    16. Disappointment with OneNote. Why would MS intentionally not release a viewer? May as well stick with a wiki
    17. I use Microsoft Office a lot. One of the things that bugs me about it is how different each of the apps are
Page 1 of 1 (11 items)