he previous article in this series
discussed how to use the Visual Studio Tools for Office (VSTO) platform to build a custom alerting application that used Outlook as the alerting engine. The ubiquity and power of the Office platform make this possible; as a developer you can exploit the capabilities already available to users via their Office installations, using Office as an application runtime platform.
Beyond that, you can also drastically improve users' experiences by building applications that mesh neatly with their daily workflow. For example consider an application that a financial analyst might use to research companieslooking at their stock price history, earnings per share, and other financial analytics. Typically, they'll use Excel to manipulate the data. Therefore, building an application that works alongside Excel will usually benefit them more than building a separate application.
That's exactly what you'll do in this article. Using VSTO, you'll look into what it takes to build a simple custom research pane that fits alongside a worksheet. This custom research pane renders detailed information about the company that a financial analyst is currently investigating in Excel.
|Figure 1. The Research Actions Pane: The figure shows a research actions pane running in Excel.|
Before you get going you'll need Visual Studio 2005, Visual Studio Tools for Office, and of course, a copy of Microsoft Excel 2003. The code supplied in this article should work with the Office 2007 betasbut I didn't test with them, so if you go that route, I'd love to hear what the results are!
With Office 2003, Microsoft introduced the concept of the Actions Pane, which by default appears on a right-hand sidebar and provides a space for UI, allowing users to take some specific action. You can see an example Actions Pane UI in Figure 1, which offers users easy access to research about a topic via a friendly UI.
The Actions Pane concept is particularly useful for applications such as Excel, where you may want to present a "typical" Windows UI to the user, containing lists, buttons, tabs and the like. This type of UI is quite unattractive if placed directly into a spreadsheet, and doesn't fit the spreadsheet paradigm. Consider what the Encarta research pane shown in Figure 1 would look like if the information were instead input directly to the spreadsheet. Not only would it be visually unappealing, but it could also detract from the user's work flow. Separating it into an Action Pane provides a more attractive and far less disruptive UI.
|Figure 2. Excel with Custom Research Action Pane: The figure shows how separating the UI into a separate Action Pane can work even for displaying relatively large amounts of text.|
Consider the case of a research action pane for a stock analyst, which might return large chunks of textual information. It is much more palatable to have this information rendered in a list or a Web browser interface within the research action pane. For example, an analyst might be researching a number of companies using a spreadsheet. As she flicks through each company, she'd like a call-out showing the details of each company. This is the ideal scenario for a research pane like the Encarta one shown in Figure 1
. The scenario might look something like Figure 2
In this case, you can see that the user has a portfolio application running in Excel that keeps track of the number of shares purchased, the purchase price, the current price and the associated Delta (earnings or losses).
Beyond the numbers in the spreadsheet, the analyst can retrieve additional company data from a different sourcedata that may help her decide whether to hold onto a particular stock or to increase or decrease her holdings. This information is a "deep dive" into company information made available in an Action Pane that renders the information for her.