Wednesday, February 14, 2007
PowerShell Send To OneNote 2007
I have been working with Microsoft PowerShell a new "interactive" command line tool. PowerShell can be downloaded from http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx and if you are a command line junkie, you will want to look at this tool. Over the last week I have been working with PowerShell to create command line scripts and cmdlets (an extensibility mechanism) to administer a custom Microsoft-based solution.
I spent the last few days pouring over documents , web sites, blogs and even a book to quickly get up to speed with PowerShell and honestly the sheer number of PowerShell features not to include the numerous major extensibility points requires more than a few days to become fluent with. Of course as I dove into PowerShell there were many places where I can easily see how OneNote 2007 and PowerShell would work well together. Most of these integration points will require some custom coding but to do a Send to OneNote 2007 from PowerShell is practically built into PowerShell.
So lets look at the output created by PowerShell using the default PowerShell host - the console. Here is the output Get-Process which will return a list of process on the host machine:
PowerShell uses a pipeline pattern where the output of one command can be the input to another command generally using the pipe character "". PowerShell will output to the default host without a terminating out command. Other out options include files and printers and OneNote 2007 (seen below) installs a print driver named" Send To OneNote 2007".
Whenever you select the Send To OneNote 2007 printer the output will create a new OneNote page located in the Unfiled Notes section of your OneNote 2007. Any application that can output to a printer can "Send to OneNote".
Armed with this we can now send the output of our Get-Process example to OneNote 2007 with no custom coding. To do this simply pipe the Get-Process output to the Out-Printer cmdlet with the -name argument of "Send To OneNote 2007" as shown below.
Sending the PowerShell output to the Send To OneNote 2007 printer will result in a new page located in the Unfiled Notes section as seen below. It will insert the output as an image. Unfortunately you do not have easy access to the text but OneNote 2007 will "full-text" search the image.
PowerShell is a very powerful command line tool - many times more powerful than Cmd.exe. This blog is dedicated to OneNote 2007 and not PowerShell so I don't expect to go into much detail with the capibilites of PowerShell. It is too expansive to cover it without writing a book. But I have more than enough interest in how PowerShell can work with OneNote 2007 out of the box as well as possible extension points of PowerShell and OneNote 2007. So you can probably expect more PowerShell/OneNote 2007 posts in the future For those of you who wish to learn more about PowerShell go to the PowerShell Technology Center located at: http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx which contains many resources including the download for PowerShell.
Labels: ON and PS
Sunday, December 03, 2006
OneNote 2007 Trial Version Released
Saturday, December 02, 2006
Windows Live Messenger Send To OneNote 2007
Sure I can open each file, copy the text, and paste it into OneNote 2007 but strangely enough I just never get around to doing that. Necessity is the mother of invention and so I set out to create a simple but effective Windows Live Messenger To OneNote 2007 (WLM2ON) add in. It turns out that with Microsoft Live Messenger's Add In Api creating a basic Send To OneNote 2007 is fairly simple. Simple enough that I will post the project code in a separate blog post.
For now if you feel the need to capture your Live Messenger content to OneNote 2007 feel free to grab the install file: WLMOneNote2007AddIn.zip which is hosted by the owners of www.onenote2006.com. This simple Send To Add In requires Microsoft Live Messenger and OneNote 2007 (RTM).
But before I go into details about how to install the binaries you should take a look at the figure below which displays a very basic page created when using this tool. I originally set out to create a robust capture tool but after reviewing the Live Messenger Add In object model it became apparent that a robust tool is either not possible yet or beyond the very short time frame I had set.
So I have settled on a secondary, simpler approach that will allow me to post the code for others to use and improve. In this approach I have created the Windows Live Messenger OneNote 2007 Add In along with a simple install project that will allow you to send session messages to a new OneNote page. There are a few issues - first you must install the add in and turn it on. Next the add in can not differentiate between Messenger sessions. This appears to be a limitation of the Live Messenger Add In framework. Messages from all sessions are saved to the same OneNote page. But it is more of a working demo than the prescriptive guidance on Live Messenger Add In development.
Once you have the binaries extracted simply run the setup file. The install is pretty simple - just remember where you install the files to. By default it will go to [install drive]\program files\Unknown OneNote Guy\WLMOneNote2007AddIn . The install will enable Live Messenger Add Ins by adding a registry key. The install will only copy the add in files to the file system. To use the add in you must "install" it in Live Messenger and then "turn it on".
To install the add in into Live Messenger you must access the Add In tab located in the Options Dialog box. The fiigure on the right displays the Add In Tab. Click Add To Messenger button and navigate to the install directory. If you did not change the install directory it will be located at: [install drive]\program files\Unknown OneNote Guy\WLMOneNote2007AddIn. Select the OneNote2007AddIn.OneNoteAddIn.dll file and click ok.The figure below displays the Add In tab with the add in selected. Click the Ok button to close the dialog box. The add in should be installed.
Note: During some of the install testing the Add In tab was available but the controls contained in the tab were not enabled. I am unsure why this is but it appears that if you restart Live Messenger and start an IM session the controls will enable.
Now that the add in is enabled you need to start the add in. To start the add in click on the control that allows you to change your online status. Select Send To OneNote to start the add in. See figure on the right.
You can use Live Messenger to send and receive IMs as before. When you want to capture your IMs in OneNote type Send To OneNote on a single line and click Send. This is interpreted as a command and will create a new page under the Unfiled Notes Section. Figure 5 displays a OneNote 2007 page that has captured messages from Windows Live Messenger. If you wish to define a title then append the command with a colon and title. For example Send To OneNote : Test IM. Figures blow displays a page that was created using the Send To OneNote command with a title parameter as well as the OneNote pages created.
Over all this was a very simple add in built to solve a relatively simple issue. The OneNote code was minimal and to be honest, simpler then the code related to the Live Messenger Add In. Give it a try and let me know how it goes. In the next post I will provide the Add In code.
Wednesday, November 15, 2006
Blogging From OneNote 2007
I maintain more than a few blogs based on various technologies. Some are actually read! All the blogs including this blog provides a web-based editing experience. These editing tools are Ok but they just cannot compare to a rich client editing scenario.
When I started this blog, I did so using OneNote 12, probably beta 2 version. I have tried Livewriter the MS blogging tool. It does a good job but it just did not provide the same writing experience as OneNote. My blog posts are part of my collection of information contained and organized in OneNote as sections and pages. Another benefit using OneNote for a blogging tool is spell check. OneNote like other Office products will provide "real-time" spell check whereas the version of Livewriter I used did not. Seeing all my misspelings:) appear with red squiggly lines is a big benefit because I can not spell.
The problem with blogging from OneNote 2007 is that it relies on Word 2007 to actually connect and push to the blog. Not a big deal, but not a great experience. Currently I create a new page under my OneNote blogging section and create my post. Once finished I then copy to NotePad. This will clean out any style tags and provide me with clean text only copy. Then it is off to the web-based blog editor where verify how it looks and tweak anything like links and images. It is truly a manual process but for some reason it is still a better fit then working out of Word or Livewriter.
So here lies opportunity, one that I can't help but think is already being addressed by the community. With the Xml-based apis for OneNote 2007 I believe it is entirely possible to create a OneNote 2007 MetaBlogAPI add in where I can go directly from OneNote 2007 to most blog by the touch of a button! If no one is moving in this direction well then lets join up and create a CodePlex site for this and have at it.
The second opportunity is that OneNote 14 should include this as a feature, similar to Word 2007. Blog postings are simply another bit of information. I go through a similar publishing process, from thought or idea to finished product on a blog site as I do with say a requirements doc. Given the choice I would like to see OneNote become the MS Blog Editor of choice…
Now that this is finished I will cut to NotePad and paste to Blogger.
Labels: I think O14 should...
Robert Gets It...
Labels: Someone Gets It...
Wednesday, October 25, 2006
I think OneNote 14 should…
Well it has been a busy few weeks. Office 2007 is about to go into RTM mode. And that means I have been busy working on Office 2007 - related products that need to be finalized. Conferences are upon us again. Seems like the last round just got over… so I am busy finalizing my various slide decks. No I will not be speaking about OneNote this time around. I have other content that must be presented and I have yet to see a conference that has some OneNote content other than TechEd and PDC. So now you know why I have not been able to post. Rest assured the OneNote XML Viewer is being improved as well as a few other interesting little apps. But for the next few weeks I am dedicated to development and slide decks...
For those of you in the OneNote community, those of you who follow all the blogs, you probably have seen Daniel's post on Send us your notes! We really want them!. You might have caught that at least some of the OneNote team is thinking vNext . Well today I was working in PowerPoint 2007 I found myself wishing the two played nicer together. So instead of keeping my thoughts to my self I decided that I should create a reoccurring topic . It seems that Blogger does not really have "categories" so I can not easily tag a set of posts as part of a specific topic. So today I create a post called I think OneNote 14 should…
So today's I think OneNote 14 should... theme is specifically about PowerPoint 2007 and PowerPoint vNext. I think you can easily extrapolate this concept beyond PowerPoint.
I think the notes page as well as normal page view where notes are displayed should be a OneNote 14 "control". Why should I settle for a basic text editor when I create notes for my presentation. Why would I not want to have my notes in a format that I can reuse? How about working on my notes in OneNote and opening up my presentation and seeing my notes show up?
To me this is a no-brainer - from a usability standpoint - not necessarily from a technical perspective. But when you think of it, why would my applications and third party applications benefit from an rich WinForm control where ever my users might benefit from collecting notes.
Now I know you are probably thinking - why not use a Side Note? That's a good question to ask. And I have the answer. I am not a big Side Note fan. Oh I use them but side notes break my momentum and thought flow. For myself Side Notes are ok for capturing quick thoughts and ideas - if later you go back and do something with them even if it is nothing more then deleting them.
I use a laptop 90 percent of the time (no tablet but that was another post:). I have limited screen space and nearly always work in full screen mode. Using a Side Note requires me to move it around or find a place one the screen that I am not using at the moment. It is pinned as the "top" screen by default and I can unpin the side note. With it pinned as the top screen I need to move it around as needed and if I change to say Outlook it is still pinned as the top screen and I have no need for that. If I unpin the Side Note it will be sent behind my PowerPoint app. Embedding the OneNote user interface as a control inside of a client will give me the basic power of OneNote located where I am used to seeing notes.
Ok, I know this is not an easy "fix" and is filled with implementation details that I would not even try to enumerate today. But if creating a embeddable control is beyond the 014 timeframe then the next step is to consider a "Smart" Side Note. One that can attach to a existing application window and would "disappear" when that specific application no longer has focus
Just an idea....
Monday, October 09, 2006
Dave Blogs About ON File Format
If you don't follow follow Dave Rasmussen's blog you should head over and read his newest post on OneNote 2003 and 2007 file format compatibility.
Wednesday, October 04, 2006
Sample Application up on OneNote Extensibility & More
Daniel Escapa has posted a good example of using the OneNote API in his Send to OneNote from Windows Explorer – Sample App post. For any of you who are interested in extensibility and OneNote you should head over and take a look at his sample. The Send to OneNote from Windows Explorer sample application explains how to use the OneNote interops APIs to embed files into a new Unfiled Section page.