I was thinking of a tool to somehow send selected pages from my different OneNote notebooks to my Windows Mobile phone and went to talk with Dan Escapa (http://blogs.msdn.com/descapa) about some design choices I was facing. He was working on a very similar tool and gave me his code to finish. Nice – saved me a bunch of time.
His design was much simpler than mine. He added a toolbar button to copy the currently viewed page to the OneNote Mobile folder when clicked. My design was much more embarrassingly clunky and I scrapped it in favor of finishing his addin.
If you want, you can get the setup files and source code from these links:
Updated setup link at http://johnguin.web.officelive.com/Documents/CopyToONMobile_Setup.zip (March 1, 2010)
(Edit: looks like WinISP got swamped very quickly. Here is an alternate download site: http://johnguin.com/Documents/CopyToONMobile_Setup.zip )
If you need the code, email me. I’ll try to restore the partial archive I have and retrieve it.
To install, as usual, exit OneNote and run the setup.exe. You will get a button to copy the currently viewed page to the ON Mobile folder. Makes life a little bit easier.
And if you click the button twice, you will discover a “feature” I added which Dan did not like. I create a simple XML file to track the GUIDs of pages already copied so you won’t get duplicates on the device. Dan wanted to keep it simple and just always make a new copy. To get his original behavior, you can select to never show that dialog again and make a copy always.
The log file (copytoonenotemobile.xml) resides in the local settings\app data folder if you want to look at it. It also logs any errors you may hit as comments. Deleting that file will cause the addin to “forget” what has already been copied.
Next up, I’ll go through some of the bugs found when testing this addin. Let me know if you find more.