October, 2006

Search
  • Engineering OneNote Blog

    Microsoft Offers Free Office 2007 Upgrades – purchase is necessary

    • 0 Comments

    You know when you see something on TV and they say "no purchase necessary"? Well this doesn't apply for this offer : )

    Anyhow today Microsoft just announced a free upgrade coupons for those who purchase Office 2003 between Oct. 26, 2006 and Feb. 28, 2007. For more info please see this article: Microsoft Offers Free Office 2007 Upgrades. From the article:

    Customers who buy a PC in the Oct. 26, 2006 - March 15, 2007 time period with Office 2003 pre-installed on the machine will receive a coupon good for a free upgrade to a similar edition of Office 2007, Microsoft said Tuesday during a conference call with reporters and financial analysts. Users who purchase the full retail version of Office 2003 between Oct. 26, 2006 and Feb. 28, 2007 will also receive a coupon.

    There is also a similar program for Windows Vista: Microsoft offers Vista upgrade discounts. Enjoy & yes purchase is necessary to get this offer.

  • Engineering OneNote Blog

    Windows Desktop Search 3.0 final version!

    • 7 Comments

    This just in, Windows Desktop Search, WDS, just went gold and is released to the web! You can get it here:

    Windows Desktop Search 3.0 RTW for Windows XP (KB917013)

    For all of the other versions for Windows 2003 Server, XP 64-bit and more go here.

    Questions you may have:

    Q: Does this work with OneNote/Outlook 2007 B2TR?

    A: Probably not well! WDS changed and fixed a lot of issues between B2TR and now so this will fix a lot of search on the desktop but it will not work well with B2TR. Once the RTM version of Office 2007 is available it will work as expected.

    Q: Should I upgrade now?

    A: If you depend on search in Outlook/OneNote no matter how buggy it is in B2TR then keep working with the same version of WDS. Then when you have the final version of Office 2007 then you can install this final version of WDS 3.0. Otherwise if you depend on search on the desktop and you have issues with the current version upgrade to the final version, search in the Office apps may or may not work great.

    I hope that answers everything, happy searching!!

  • Engineering OneNote Blog

    Next steps with Connect

    • 5 Comments

    As you may know we are nearing the end of the Office 2007 beta and we are getting ready to release Office 2007! Office 2007 is schedule to be available to business customers (and I assume MSDN subscribers) in Oct 2006 and it will be available to consumers in Jan 2007, see here: Microsoft Confirms Timeline for 2007 Microsoft Office System. So what does that mean for the Connect site which is designed for handling betas and beta feedback? We are still going to use the Connect site!

     

    As you can tell from my last post we really do listen and we really value your feedback, that being said we consider the OneNote Connect site a success. We want to continue with that success and we will:

    • Continue to watch the feedback coming into the Connect site
    • Continue to look for bugs or issues we can fix in a service pack
    • Continue to solicit feedback, suggestions and feature ideas for future release of OneNote

    We will do all of this with the Connect site and once there is a beta of the next release available we should gear up the Connect site again. Although our replies on the Connect site might take longer we will continue to monitor it. I think most of us just want to take a vacation and clear our heads.

     

    I would suggest that everyone look @ the public newsgroup:

    BTW We read these as well : )

     

    If you have questions/concerns please post in the comments below.

  • Engineering OneNote Blog

    Customer Feedback – a Success Story & Thank you

    • 5 Comments

    From: OneNote team

    To: OneNote User Community

    Subject: Customer Feedback – a Success Story & Thank you

    We would like to thank everyone who has posted bugs and posted feedback for the beta program for Office 2007 and in particular OneNote 2007. For some of you who have been on BetaPlace you have been logging bugs for over a year now; from Beta1, B1TR and then into the public beta: Beta2 and finally B2TR. Then we had even more feedback on the public newsgroup and the Connect site. When people searched for "log a bug OneNote" they would get our site and they would be talking with us on the team.

    Why am I writing this? I wanted to do a few things with this. First of I wanted to have some greatest hits for the beta programs showing how your feedback made a huge impact on the program, so without further ado your feedback top items:

    Battery life and performance

    When beta1 first came out we reached out to many customers who were Tablet users and they were using the new ink & Tablet features. Needless to say this was a huge new improvement and investment in ink in OneNote 2007 and we were still working out the kinks so performance was still being worked on. I can hardly tell you how many of the beta users complained about problems in the early betas. Based on all of your feedback we were able to get our performance better and we also added this to the Tools-->Options dialog:

     

    You all wanted this so we gave it to you; you can change the battery options so that your laptop/Tablet will last longer.

    Notes that didn't upgrade well

    One of my favorite bugs was a problem where the file didn't upgrade correctly or it didn't look right. You can see the bug here: Converting 2003 notes to 2007 Beta 2 results in ink misalignment. Because of this feedback we were able to find a bad bug with upgrade and the fix should greatly improve your experience in this case. Even though we had been testing this for months internally this file, submitted by pschneider, was a great way to show us a bug that we had.

    I can't tell you how great this bug was : )

    OneNote 2003 note flag upgrade problems

    This was another great bug; you can see the problems people had with this, like this bug: Flags don't migrate from OneNote 11 to 12 (and more). Pretty much without your submitted files we wouldn't have been able to track down this problem. So thanks again everyone!

    Corrupted files

    I think you might be seeing a trend here; your files and your computers have different configurations which expose problems. There were some corrupted files that we got through the Connect site that were useful.

    Move Pages to appeared broken

    This was a top item from Mike who wanted me to put this in here. I didn't even see this bug until he wanted me to post it but it is very good. You can see it here: 'Move Page To' no longer shows path to destination folder/notebook/section group and here is an image to illustrate it:

     

    This image and feedback was just what we needed and the developers fixed it up in no time and the testers verified that it worked.

     

    You can see your feedback has been invaluable to us and it felt great to get all of the feedback that we did. We would pass on your complaints and your praise to the entire team; you all are the best fans and we want to work hard to make sure it happens. The other day Mike forwarded me this link: Bug and issue tracking – Good job Microsoft! which talks about the Connect program and how useful it has been, so hats off to them for allowing us to have this, they have a blog here: Microsoft Connect Feedback Blog.

  • Engineering OneNote Blog

    Add a reference to OneNote 2007? No longer under .Net but under COM

    • 8 Comments

    There was a change in setup between B2TR and the RTM build where the Office .Net PIAs are no longer placed in the proper place so they appear in the .Net References tab in Visual Studio. What does this mean for you? It means that if you want to add a reference to OneNote you can _no longer_ look under the .Net tab, instead look under the COM tab.

    So I would like to amend what the Unknown OneNote blogger mentioned earlier on this post: Referencing the OneNote 2007 APIs in Visual Studio he said this:

    1. Creating a VS .Net references is simple. In a Visual Studio 2005 you can access the references from the Solution Explorer. If the Solution Explorer is not visible you can access it from the View menu or use the shortcut Ctrl-W, S. Figure 1 shows my Visual Studio's Solution Explorer.

    Figure 1: VS Solution Explorer

    1. To create a reference to the OneNote interop dll right click the reference node in the Solution Explorer , and select Add Reference to bring up the Add Reference Dialog as shown in Figure 2.

    Figure 2: Add Reference Dialog

    1. Select Microsoft.Office.Interop.OneNote and click the Ok button. You should see the reference listed under the Reference node in the Solution Explorer as shown in Figure 3.

    Figure 3: VS Solution Explorer with OneNote reference

    You can now access the OneNote API. Check back later as we work our way though the OneNote 2007 API.

    I am only changing the part under figure 2, but otherwise it all works exactly the same, just a different way to add it. If you have questions please let me know; of course you won't see this until the RTM version comes out.

    Thanks a bunch Unknown OneNote blogger!

  • Engineering OneNote Blog

    What being a PM is all about & a real spec

    • 0 Comments

    I was just reading this blog about the Windows Shellshell:revealed blog and I saw a post from VinnyP which is A look into the feature design process. My thoughts:

    1. If you want to learn about MS and how software is designed read this post
    2. This is what I do, Olya, David, Owen & Chris, we are PMs!
    3. You can read a _real_ spec that was used in Windows Vista

    It is a great post, highly recommended.

  • Engineering OneNote Blog

    Fix for Daily Journal in OneNote 2007

    • 1 Comments

    I was reading my feeds, I am way behind, and I saw this great post from AdminID over @ OneNote PowerToys, which discusses how to fix the Daily Journal for OneNote 2007. Here is what AdminID says:

    I was manually recreating the functions of the Daily Journal PowerToy using the same format and a "Links" page with a hyperlink to the section, but came across a tip by Ilya Koulchin this morning…To get the Daily Journal PowerToy to work in OneNote 2007…

    • Have to use the first open Notebook
      • Create a Section Group named "Journal"
      • Inside of that create a Section Group named "2006
      • Start up OneNote Daily Journal and press Windows-J for it to create a Section for the month and a page for today.

    And you can see what Ilya said earlier:

    We've tried to maintain compatibility with existing plugins for this release, however, due to the many improvements (such as allowing users to have multiple notebooks), it is not always clear how to map previous functionality into the new model, as evidenced in this case. In the future, if you discover other plugins that don't work as expected you can log them as bugs on the connect site.

    Ilya is one of the kickass developers on the team who have been working on sync'ing, the API and more. Thanks Ilya & AdminID!

  • Engineering OneNote Blog

    Add OneNote Mobile to your speed dial!

    • 7 Comments

    I *finally* got myself a Windows Mobile device, the Motorola Q, and I have to say that I love it. There are a few bugs but otherwise it is a great experience for a phone and for email and more. As you could guess I have been using OneNote Mobile a whole lot more now and it is great. I have been taking notes and leaving myself reminders and grocery lists. One thing I wanted to point out was the ability to add OneNote Mobile to your speed dial see here:

    Just click Start and find OneNote Mobile and then choose Menu and then Add Speed Dial and you are done! I use this feature just for this scenario where I want to take a quick note and I just hold down 9 and bam! I am in OneNote.

    Anyone have other OneNote Mobile tips & tricks? Please share them!

  • Engineering OneNote Blog

    Timebomb date for B2TR – When it stops working

    • 1 Comments

    As many of you are aware Office 2007 B2TR is set to expire sometime next year. I wanted to post those dates and make them more public:

    • March 31, 2007 - all client products
    • May 15, 2007 - all server products

    Make sure to save all of your data or upgrade before that date!

  • Engineering OneNote Blog

    Send a Smile feedback tool - no comments accepted after October 14

    • 6 Comments

    I have written about Send a Smile before and it looks like it is time for it to be over. It has been a very valuable feedback tool for us on the team and we value your input however we are transition from finishing Office 2007 (Office12) we are now moving to planning and working on Office14; that being said the Send a Smile tool will be discontinued on 14-Oct-2006. Here is the announcement:

    Thank you for using the Send a Smile tool to tell us about your 2007
    Microsoft Office system experiences! Starting with early builds of the 2007
    Office system and continuing through the Beta2TR build, you have sent us more
    than 40,000 smiles and frowns, and we are thankful for every one of them.
    Reading your comments has been fun and insightful, but most importantly, it
    has continually helped us improve Office. Your Send a Smile feedback had a
    tangible impact on the product and your comments influenced many of our
    decisions over the last year.

    The Send a Smile tool has been designed exclusively for managing beta
    feedback. Due to the manual nature of processing feedback submitted using the
    tool, we regret we will no longer be able to respond to Send a Smile feedback
    after October 14, 2006. We will continue to investigate ways to make it easy
    for you to provide us with feedback of this nature in the future with an eye
    toward improving our processing system for this feedback.

    Please uninstall the Send a Smile tool before October 31, 2006, by following
    these steps:

    1. From the Start menu, point to Settings and then click Control Panel.
    2. Double-click Add/Remove Programs.
    3. In the list of currently installed programs, select Microsoft Office
    Information Worker Feedback Program and then click Remove or Add/Remove. If a
    dialog box appears, follow the instructions to remove the program.
    4. Click Yes or OK to confirm that you want to remove the program.

    Thanks again for using the Send a Smile tool!
    --
    Mirko Mandic - Office User Experience Program Manager

    (Link1) (Link2)

    Thank you all for your feedback via this tool, but please uninstall it and get that hard drive space back : )

  • Engineering OneNote Blog

    OneNote Audio Search & Audio Search Languages

    • 11 Comments

    I am not sure if everyone knows about OneNote's Audio Search but this is the information from the OneNote Guide:

    With the Audio Search feature enabled, you can search your audio and video recordings for words, just like you would search for typed text in your notes. For example:

    • Record phone conversations with customers, and later search for keyword of topics that you discussed
    • Record an interview and then search for specific quotes
    • Record voice reminders on a Windows Mobile Smartphone or Pocket PC. After you synchronize them with OneNote, you can search through your reminders.

       

    Important! Recordings must be made with a good quality microphone or phone that is close to the speaker's mouth. Audio recognition technology does not have perfect accuracy and is very sensitive to recording quality, ambient noise, and distance.

       

       

    You can enable the Audio Search feature in Tools > Options > Audio and Video.

    The audio recognition process and indexing happens only when the computer is left idle and OneNote is running. It will take at least twice the length of a recording, so you'll have to let OneNote index for some time before you can begin searching.

       

    When Audio Search is enabled, use the regular search box (above the page tabs) to type your search term and then click View List to see the audio results at the bottom of the results pane.

       

    Why do I keep getting poor results (or no results at all)?

    You may be searching for a sound that occurs in too many words. For example, if you search for "Asia," you may get "information", "conversation", "ratio", "hey Sean", and so on.

       

    Here are some workarounds that might help you:

    • Longer words

    Try to recall one of the longer words mentioned in the recording. You will get best results with words of three or more syllables.

    Example: imagination; Microsoft

    • More words

    If you can only think of short words, try to recall an exact phrase that may have been mentioned.

    Example: Frank wrote;

    • Spell out the sound of unusual words

    If you are looking for an acronym or an unusually spelled word, spell out how it is pronounced

    Examples: em es en (for MSN); ex box (for XBox); area code four two five (for code 425)

       

       

    Visit the Office Online Help topic or article most relevant to this OneNote feature. Our site is frequently updated based on user feedback, so keep checking back!

       

    Olya might want to comment more on this as she is the owner of audio search but I also wanted to mention which languages are supported:

    1. English
    2. Japanese
    3. Chinese Traditional
    4. Chinese Simplified
    5. Korean
    6. German
    7. French
    8. Spanish
    9. Italian

    Enjoy everyone! In B2 & B2TR I believe it was turned off by default and in the final version it should be turned on by default. Please try it out!

  • Engineering OneNote Blog

    Send us your notes! We really want them!

    • 6 Comments

    Back during the development of OneNote 2003 the team had customers send in their paper notes. You can see Chris' from January 2004, Handwriting on the wall:

    We started out with an effort to collect handwritten (and typed) notes. We asked about 1000 registered users of Microsoft products (who had agreed to be contacted in advance) to send us a manila envelope full of their notes (whatever that meant to them), in return for $20. We got notes from about 500 people, which we posted on the walls of our hallway (picture to come later). We categorized them into groups. People who use outlines (hardly any, confirming my bias), people who make lists, people who mix drawings and text a lot, people who write paragraphs, people who use no discernable structure, etc. We also had classes of notes like post-its, course notes, and interview notes. And notes from other countries, lawyers, notes from meetings on handouts, etc.

    We put these notes on the wall because I wanted them to be easily accessible. If we ever had a discussion about whether "users do this" or "users do that", it should be as easy as walking out into the hallway to check. And we did. Many arguments were settled pretty quickly. The "wall o' notes" was one of the more successful things we did in the OneNote project.

    I actually have the box of those notes sitting in my office and as we start planning the next release of OneNote we would like to do the same thing again.

    Please send us your notes!

    That being said I would encourage you all to upload your notes to the team!

    Why: Why do we want your notes? That is a great question and really it is about understanding how you take notes. How do people organize their notes? Do users use note flags? How do you ink? What do your notes look like? Do you use fonts and styles for a lot of items? Do your notes look right after upgrading?

    What: We are looking @ getting OneNote 2003 notes as well as OneNote 2007 notes. If you are using OneNote 2003 please create a zip file of your notes that you would like to submit to us. If you are using OneNote 2007 please use a OneNote package (learn how to create one). Please include your email address in the filename so that we can know who you were : ) For example I would upload my notes with this filename: "on12beta@micorsoft.com - Class Notes 2005.onepkg".

    How: You can upload your notes on this site: https://sftus.one.microsoft.com/choosetransfer.aspx?key=d435d48b-9481-4d14-8665-c39605fb6d9e but you need a password to do so. Since I can't email out the password please email me: on12beta@microsoft.com or use the email button @ the top of this page and request the password. Once I get it from you then I will send you the password and you can upload the file. You can also email me the file directly but email attachments are capped @ ~8megs and this site will support files up to 1.9gigs so it is a better location.

     

    Note: Don't upload private or sensitive data! We will only be using these notes internally for the product team, but don't send us anything that you aren't comfortable having other people read.

     

    I hope the Star Wars reference isn't lost on people; using the Force to help you want to send your notes. Maybe it has just been a wacky day for me : )

    © Lucas Films for all of the images

  • Engineering OneNote Blog

    Creating OneNote single file packages, archiving & notebook templates

    • 9 Comments

    I am not sure if I have blogged about this before but you can easily create single file archives for entire notebooks, sections or pages in OneNote. This will include all of the embedded files, the notes, audio & video and section groups, everything all together like a zip file. We call them OneNote Packages, or single file package, the file extension is .onepkg.

    Why would you create .onepkg files? Well there a few reasons why you might do this. First of all you can easily archive an entire notebook for future keeping. You can also use these to send a notebook or collection of notes to another colleague. Finally you can create notebook templates for projects or other repeatable projects.

    How do you create .onepkg files? Easy! Just open OneNote 2007, go to the notebook/section/etc that you want to archive and choose File-->Save As. In the resulting dialog change the Page Range to whatever you want to save, typically Current Notebook. Then choose Save as type: OneNote Single File Package (*.onepkg) and then type a file name, like this:

    Choose Save and you will have the file for your package!

     

    How do I create new notebook templates? You can easily install new notebook templates by storing your .onepkg files in the following folder:

        %userprofile%\Application Data\Microsoft\Templates

    Just place the .onepkg in there and then it will appear in the new notebook wizard when a user choose File-->New Notebook. You can also store them system-wide, like when you are deploying OneNote to many computers, by storing the file here:

    %programfiles%\Microsoft Office\Templates\1033\ONENOTE\12\Notebook Templates

    Note that the 1033 folder is for English, check your local computer for your LCID = language ID.

  • Engineering OneNote Blog

    OneNote file formats, changes between 2007 & 2003

    • 0 Comments

    As those of you who are using OneNote 2007 know the file format in OneNote 2007 is completely different from ON2003.  That being said David has a great post: Why the OneNote 2007 and 2003 file format are different.  Some interesting tidbits:

    Impact of this difference on interactions between OneNote 2007 and 2003 clients

    • OneNote 2007 can open OneNote 2003 files read only. This is the default. In this case the format will not be changed and the files will still be editable and viewable by another OneNote 2003 client, and they can be viewed in OneNote 2007 but not modified.
    • OneNote 2007 can UPGRADE OneNote 2003 files. The user is prompted and asked before doing this and it is explained that OneNote 2003 clients will no longer be able to open them. In this case, the file is now fully editable by all 2007 clients but no 2003 clients.

    <snip>

    We understand this issue will cause inconvenience for some, and trust me we did not take this decision lightly. It was a very difficult and painful decision. We do think the improvements in OneNote 2007 are pretty dramatic and compelling and were worth the change. Thankfully many of our beta users seem to agree. Also the upgrade pricing for OneNote is reasonable, so given the compelling improvements we expect as most people upgrade (particularly those who want to share with other machines), this will quickly become less of an issue.

    On a final note, rest assured that we are very committed to file format compatibility as a goal for future OneNote versions.

  • Engineering OneNote Blog

    Question about embedded files and audio/video

    • 1 Comments

    I received the following question via the feedback link on this blog and I thought I would share the answer with everyone; write once, publish everywhere : )

    I've read the OneNote, What's New for Developers Pts 1 and 2 and looked at the XML schema stuff. Can't find any information about what types of files (extensions, file types) that can be inserted, and what types of audio/video file types are compatible and insertable. Can you point me to the appropriate documentation or answer this directly?

    Great question. You can insert any file type into OneNote! By default we don't restrict why files you can put onto a OneNote page, you can put anything that you may want and it will appear on the page. Of course system administrator can turn this off and the API will respect this settings. We have enabled admins to disable the "Insert Files" feature as well as disable the ability for users to open inserted files (I sometimes call them embedded files, sorry for the doublespeak). We also have policies to turn off certain types of file, like it is okay to open Word .docx but you can't open a .exe file.

    Next part about what audio/video files are compatible with OneNote. Well it really depends on what you are trying to do; if you just want the file to be on the page you can do that by just insert it. However if you want to insert an audio/video file and have linked notes (like when you choose to insert an audio recording) then you would need to use: WMA, WMV, WAV, MP3, etc. I believe anything that has a DirectShow filter installed. I just tried with the following formats and it worked without any problem. Hope this helps!

  • Engineering OneNote Blog

    Send to OneNote from Windows Explorer – Sample App

    • 26 Comments

    It has been awhile since I have blogged about the OneNote API so I thought I would post a nice long article showing a sample app I made awhile ago.

    Goal: Write an app that allows you to send a file from the Windows shell directly to OneNote, and it looks like this:

    High-level: We will write an app that takes command line args that are paths to files. We will then create XML for a page in OneNote which contain embedded files pointing to these source files. Import this all into OneNote and success.

    Requirements: Visual Studio 2005 & OneNote 2007 (this XML works with the RTM version)

    Steps:

    1. Create a new Windows application. Even though my app is 100% console based and doesn't need the Windows UI it is just good to create this so that you don't see the app's window on the Taskbar.
    2. Add a reference to OneNote's COM object model. In the Solution Explorer find References, right-click on it and choose Add Reference. Go to the COM tab and hit "m" and look for Microsoft OneNote 12.0 Object Library, select it and choose OK.
    3. Add this line for your using statements:

      using OneNote = Microsoft.Office.Interop.OneNote;

    4. For this sample I will create a new class to do all of the work required for this, and I will call it Send2OneNote. Send2OneNote will contain a reference to OneNote and it will also have a importFiles method that will create XML and import it into OneNote's Unfiled Notes section.
    5. This is the class' constructor and destructor:

      class Send2OneNote

      {

      private OneNote.Application onApp;

      public Send2OneNote()

      {

      try

      {

      onApp = new Microsoft.Office.Interop.OneNote.Application();

      }

      catch(Exception e)

      {

      MessageBox.Show("Please install Micorosft Office OneNote 2007");

      onApp = null;

      Environment.Exit(-99);

      }

      }

           

      ~Send2OneNote()

      {

      onApp = null;

      }

      As you can see when you first instantiate the class it will get a COM reference to OneNote, if OneNote isn't installed then we will throw a dialog box @ the user and we exit. Don't ask me why I use exit error code -99, heck I imagine that most of you will say that you don't even need an error exit code, but whatever : )

    6. Now we will want to start writing importFiles, but we need to think about what it needs. I mentioned earlier that we will be add a new page to the unfiled notes section. And if you are familiar with the OneNote API you can see from the CreateNewPage() call that we need an ID to pass in, so I will write a small helper function called findUnfiledID() which returns the ID to the Unfiled Notes section; here it is:

      private string findUnfiledID()

      {

      string unfiledID = "";

           

      try

      {

      string unfiledPath;

      onApp.GetSpecialLocation(Microsoft.Office.Interop.OneNote.SpecialLocation.slUnfiledNotesSection, out unfiledPath);

      onApp.OpenHierarchy(unfiledPath, null, out unfiledID, Microsoft.Office.Interop.OneNote.CreateFileType.cftNone);

      }

      catch (Exception e)

      {

      MessageBox.Show("Couldn't get your Unfiled Notes Location");

      onApp = null;

      Environment.Exit(-99);

      }

           

      return unfiledID;

      }

      What does this do? I call OneNote and I ask it for the path to the Unfiled Notes section (that is the GetSpecialLocation call) and then I ask OneNote to open that path and give me back the ID. You might ask why would I do this if OneNote already has the Unfiled Notes open, well this is an easy way for me to get the ID instead of needing to parse through XML or anything else. Anytime you ask OneNote to open something (with OpenHierarchy) then OneNote will return the ID back to you.

    7. Okay so now we have the Unfiled Notes' ID and now we just need to create the XML and insert it into OneNote. Let's look @ a page that contains an embedded file, just so we can get an idea of what we will need to create ourselves:

      <?xml version="1.0"?>

      <one:Page xmlns:one="http://schemas.microsoft.com/office/onenote/2007/onenote" ID="{9DF3CC2B-E016-4F0F-AB50-E9B62532839A}{1}{B0}" name="Sent Files">

      <one:Title>

      <one:OE author="Daniel Escapa" lastModifiedBy="Daniel Escapa" creationTime="2006-10-04T02:13:43.000Z" lastModifiedTime="2006-10-04T02:13:44.000Z" objectID="{7F6FE609-34C0-4D0B-9A39-AB52DADC2BC2}{31}{B0}" alignment="left">

      <one:T><![CDATA[Sent Files]]></one:T>

      </one:OE>

      </one:Title>

      <one:InsertedFile pathCache="D:\Documents and Settings\descapa\Local Settings\Application Data\Microsoft\OneNote\12.0\OneNoteOfflineCache_Files\Sample file.one" pathSource="D:\Documents and Settings\descapa\Desktop\Sample file.one" preferredName="Sample file.one" lastModifiedTime="2006-10-04T02:13:44.000Z" objectID="{7F6FE609-34C0-4D0B-9A39-AB52DADC2BC2}{36}{B0}">

      <one:Position x="36.0" y="86.4000015258789" z="0" />

      <one:Size width="54.0" height="63.0" />

      </one:InsertedFile>

      </one:Page>

      I did take out some of the XML but you can see the basics of the page here. I have a title which says "Sent Files" and then there is an embedded file on the page which is for the file "Sample file.one". You can see that we have a pathSource and a pathCache attributes on the InsertedFile element. The IDs & objectIDs will be filled in by OneNote once the XML has been imported and there are other special items like exact positioning that we can ignore when we import content. If you really wanted to place this in a certain location we could do so, but let's just deal with the basics now.

      You can easily embed a file in OneNote because you just need to specify the path via the XML and then OneNote will do the rest. You don't need to actually break down the file and put it on the page, just give it a path. OneNote will then take this, insert it into the file, and put a cached copy in the OneNote cache.

      I think we can go and write insertFiles().

    8. I will just paste the code for insertFiles and then we can discuss it and why I did it the way that I did:

      public void importFiles(string[] args)

      {

      string unfiledID = findUnfiledID();

      string importedPageID = "";

           

      try

      {

      onApp.CreateNewPage(unfiledID, out importedPageID, Microsoft.Office.Interop.OneNote.NewPageStyle.npsDefault);

      }

      catch (Exception e)

      {

      MessageBox.Show("Could not create a new page! Error code: " + e.Message);

      onApp = null;

      Environment.Exit(-99);

      }

           

      string xml2importBase = "<?xml version=\"1.0\"?>\n<one:Section xmlns:one=\"http://schemas.microsoft.com/office/onenote/2007/onenote\" ID=\"";

      xml2importBase += unfiledID + "\">\n";

      xml2importBase += "<one:Page ID=\"" + importedPageID + "\">\n";

      xml2importBase += "<one:Title>\n<one:OE>\n<one:T><![CDATA[Sent Files]]></one:T>\n</one:OE>\n</one:Title>\n";

      string tailXml = "</one:Page>\n</one:Section>";

           

      bool succeeded = false;

           

      foreach (string s in args)

      {

      string xml2import = xml2importBase + "<one:InsertedFile pathSource=\"" + s + "\"></one:InsertedFile>\n";

      xml2import += tailXml;

      try

      {

      onApp.UpdateHierarchy(xml2import);

      succeeded = true;

      }

      catch(Exception e)

      {

      if (args.Length == 1)

      {

      try

      {

      onApp.DeleteHierarchy(importedPageID, DateTime.MinValue);

      }

      catch (Exception e1)

      {

      MessageBox.Show("Could not delete page and error on insert, bailing! Error: " + e1.Message);

      onApp = null;

      Environment.Exit(-99);

      }

      MessageBox.Show("You cannot import a folder into OneNote!");

      onApp = null;

      Environment.Exit(-99);

      }

      else

      {

      //supressed, we just hit a folder but we will jsut keep on going...

      //MessageBox.Show("Couldn't import " + s + " into OneNote. Error code: " + e.Message);

      }

      }

      }

           

      if (!succeeded)

      {

      try

      {

      onApp.DeleteHierarchy(importedPageID, DateTime.MinValue);

      }

      catch (Exception e)

      {

      MessageBox.Show("Failed to delete the page with nothing on it. Error: " + e.Message);

      //add code to remove this stuff!

      }

      MessageBox.Show("You cannot send folders to OneNote!");

      }

      else

      {

      onApp.NavigateTo(importedPageID, null, false);

      }

       }

    *wipes brow* Okay lots going on here so I will take look @ each part.

    1. Creating a new page in the Unfiled Notes section:

      public void importFiles(string[] args)

      {

      string unfiledID = findUnfiledID();

      string importedPageID = "";

           

      try

      {

      onApp.CreateNewPage(unfiledID, out importedPageID, Microsoft.Office.Interop.OneNote.NewPageStyle.npsDefault);

      }

      catch (Exception e)

      {

      MessageBox.Show("Could not create a new page! Error code: " + e.Message);

      onApp = null;

      Environment.Exit(-99);

      }

      This code will create a new page, with CreateNewPage, in the section that I supply with unfiledID and then it will output the new pageID. If it fails then we capture that error code but in most cases this should never fail, but you _just_ never know.

    2. Now I have the main XML that I am importing into OneNote:

      string xml2importBase = "<?xml version=\"1.0\"?>\n<one:Section xmlns:one=\"http://schemas.microsoft.com/office/onenote/2007/onenote\" ID=\"";

      xml2importBase += unfiledID + "\">\n";

      xml2importBase += "<one:Page ID=\"" + importedPageID + "\">\n";

      xml2importBase += "<one:Title>\n<one:OE>\n<one:T><![CDATA[Sent Files]]></one:T>\n</one:OE>\n</one:Title>\n";

      string tailXml = "</one:Page>\n</one:Section>";

    3. The next part is the main part of code which inserts this into OneNote:

      bool succeeded = false;

           

      foreach (string s in args)

      {

      string xml2import = xml2importBase + "<one:InsertedFile pathSource=\"" + s + "\"></one:InsertedFile>\n";

      xml2import += tailXml;

      try

      {

      onApp.UpdateHierarchy(xml2import);

      succeeded = true;

      }

      catch(Exception e)

      {

      if (args.Length == 1)

      {

      try

      {

      onApp.DeleteHierarchy(importedPageID, DateTime.MinValue);

      }

      catch (Exception e1)

      {

      MessageBox.Show("Could not delete page and error on insert, bailing! Error: " + e1.Message);

      onApp = null;

      Environment.Exit(-99);

      }

      MessageBox.Show("You cannot import a folder into OneNote!");

      onApp = null;

      Environment.Exit(-99);

      }

      else

      {

      //supressed, we just hit a folder but we will jsut keep on going...

      //MessageBox.Show("Couldn't import " + s + " into OneNote. Error code: " + e.Message);

      }

      }

      }

      This might seem like a lot of code but what I am doing is going through each string in the arguments (that came from Windows Explorer when I chose to send to OneNote).

      There is a lot more going on with this code for example I put all of the XML together and you can see to embed a file you only need to provide the pathSource. I then send this to OneNote with the UpdateHierarchy method, you might ask why I do this for each individual file instead of creating the XML for all of the files and import that together? I did this because I wanted my imports to be more transactional; if something failed to import I wanted to know more about it and have something atomic that I could rollback if need be. It also made my code pretty clean and easy (imho).

      If we failed on the import that means that we tried to insert something which cannot be embedded which was probably a folder. If the user only tried to import the folder this is invalid and we throw an error to the user. I also go ahead and delete the page that I just created, otherwise the user would have a blank page in their Unfiled Notes.

      However if we were successful I go through and do this for each file that was passed to our app.

    4. The final part of this code is error handling and last steps. If we were successful importing the files we will navigate the user to the newly created page, otherwise we will delete the new blank page because the user tried to send only folders which are invalid. See here:

      if (!succeeded)

      {

      try

      {

      onApp.DeleteHierarchy(importedPageID, DateTime.MinValue);

      }

      catch (Exception e)

      {

      MessageBox.Show("Failed to delete the page with nothing on it. Error: " + e.Message);

      //add code to remove this stuff!

      }

      MessageBox.Show("You cannot send folders to OneNote!");

      }

      else

      {

      onApp.NavigateTo(importedPageID, null, false);

      }

         

    The last steps would be to test this out and put a shortcut in your SendTo folder under your user profile. At some point I hope to package this all up and make it a download that anyone can easily use. I guess I will have to wait until RTM when we don't have any more changes in the code.

    As always I appreciate your feedback and thoughts on this, hope you learned something.

    Update: I am including the source as well, you can find it here: SendtoOneNote.zip

  • Engineering OneNote Blog

    OneNote Blog posts over the past month

    • 1 Comments

    Here is another set of these from Mike our Test Manager:

    1. "OneNote 2007 Beta -- I REALLY LOVE this upgrade." 
    2. "The beta version of OneNote 2007 is heads and tails over the previous version.  For this reason, I'm now fully encouraging it's use."
    3. "the inking experience and the searching experience in OneNote 2007 is so vastly improved that it really makes taking and retrieving of notes a breeze." 
    4. A new, prolific blogger called "The Unknown OneNote Guy" has posted over 20 entries in 2 months! 
    5. Some great, detailed feedback on OneNote 2007 B2TR (good and bad) 
    6. "It started with him saying OneNote's multi user document editing feature was the future" 
    7. OneNote 2007 - the perfect reporter's tool 
    8. "How to organize your life with Microsoft OneNote" 
    9. A new OneNote Community site has sprung up at http://www.onenote2006.com 
    10. A poll for a OneNote keyboard only slogan - current leader is "OneNote: we don't need no stinkin' pen"
  • Engineering OneNote Blog

    Restoring the OneNote Guide

    • 9 Comments

    When you first open OneNote 2007 you are greeted with the OneNote Guide. I would encourage all of you to leave this open and take some time to read though it. There aren't that many pages and you will learn a great deal about OneNote 2007 and what features are available.

    However if you to close it and you want to reopen it here are two ways to do this.

    If you didn't delete the OneNote Guide notebook folder then you can do this:

    1. Open OneNote
    2. File-->Open-->Notebook
    3. Go to Documents\OneNote Notebooks
    4. Find the OneNote Guide folder and click on it
    5. Click Open
    6. Success!

    If you deleted the OneNote Guide notebook folder then please do this:

    1. Open OneNote
    2. File-->Open-->Section
    3. Go to %programfiles%\Microsoft Office\OFFICE12\LCID\
      The LCID is the folder for your language & locale; for EN-US this is 1033
    4. Double click on ONGuide.onepkg
    5. Unpack the notebook by going through the wizard
    6. Success!

    I just wanted to pass on this information for those of you who want to get back to the OneNote Guide even though you closed it or deleted it; just an easy way for your to restore the OneNote Guide. If you have questions let us know!

  • Engineering OneNote Blog

    Introducing our newest OneNote MVP: Patrick Schmid

    • 1 Comments

    I just heard this weekend from Patrick Schmid that he is an MVP for OneNote! Congratulations Patrick, I know you have done a great job contributing to the OneNote Newsgroups and submitting bugs for us.

    I would like to tip my hat to all of the OneNote MVPs, especially the ones I have worked with: Ben Schorr, Erik Sojka & Kathy Jacobs.

Page 1 of 1 (19 items)