Random Technical Stuff RSS 2.0
 Friday, December 07, 2007

If you are like me you spend much of your time in the Office suite of applications, but as a developer or architect I used to rarely think about incorporating Office into my solutions.  I guess I spent too much time debugging Excel macros or struggling with the plumbing when I first starting playing with the Visual Studio Tools for Office (VSTO).  It seemed like more work that it was worth.  This was a shame because Office has some great advantages as a compliment to custom application development.

With the latest release of Office 2007 and Visual Studio 2008 the plumbing for extending the UI around Office applications has drastically improved.  I created the attached video (no audio on this one)  to show a quick example (7:34 to be exact) of how to create a Word add in.  In this example I take the following steps:

  • Create a new Word Add-In project
  • Add a Ribbon item to extend the Ribbon UI in Word
  • Modify the custom ribbon to name things friendly and add a toggle button
  • Add a User Control to hold my UI for my Task Pane
  • Modify the Add-In code to attach the user control to Word and create methods to show and hide the custom task pane
  • Write code behind the ribbon toggle button that calls the show and hide methods for the task pane
  • Run the application to show the extended ribbon user interface and how clicking on the custom toggle button shows and hides my user control
  • Adding some winforms controls to the user control and wiring them up to pull and push content from my user control to the document
  • Running the application again to show the user control in action reading content from the document and writing content back to the document

This is a fairly simplistic example, but enough to get started.  I have written some other demos that hook up the user control to a SQL Server database to populate form letters from customer data.  If you are interested in learning more, I'd suggest checking out the VSTO on MSDN.  One other thing - VSTO used to be a separate product that you needed to purchase on top of Visual Studio.  With VS 2008 Professional, VSTO is included right in the box.

Double click the video once it starts to see it full screen.  You can double click again on the full screen to go back to regular view.  If you are reading this in an RSS reader, you most likely need to go to the site to see the video.

 

This video was published via Silverlight Streaming

7-Dec-2007 6:05 PM  #    Comments
Office | Office Apps

Comments are closed.
Archive
<September 2008>
SunMonTueWedThuFriSat
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011
About the Author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Joe Shirey
All Content © 2008, Joe Shirey