Kevin Schuler, Drew Robbins
InDepth Technology
November 2004
Applies to:
Microsoft Visual Studio Tools for the Microsoft Office System, Version 2003
Summary: Hundreds of blogs offer first-hand experience and tips for designing, implementing, and deploying smart client solutions built with Microsoft Visual Studio Tools for the Microsoft Office System, Version 2003. Check out some of the best articles we found. (8 printed pages)
Contents
Introduction
Blog Articles
Additional Resources
Introduction
Visual Studio Tools for the Microsoft Office System, Version 2003, enables developers to use Microsoft Office 2003 as a platform upon which to build and deploy complete business solutions using the full power of Microsoft Visual Studio .NET 2003. Visual Studio Tools for Office helps make rich client application development on the Microsoft Office System secure, reliable, and faster-to-develop by using Visual Studio to create document-centric solutions that run with Microsoft Office Excel and Microsoft Office Word. Additionally, applications built with Visual Studio Tools for Office are easier to maintain and upgrade than those built with previous Microsoft Office programming models. Solutions built using Visual Studio Tools for Office run inside the common language runtime (CLR) and can take advantage of class libraries and services provided by the Microsoft .NET Framework.
Since the first version of Visual Studio Tools for Office was released over a year ago, bloggers have been discovering and writing about how to design, implement, and deploy Visual Studio Tools for Office solutions for Word and Excel. Included in this article are links to many of the best blog entries we found.
Background
Since we started aggregating blogs for conferences such as Microsoft Tech Ed and Microsoft Professional Developers Conference (PDC), over 50,000 articles from more than 500 bloggers have passed through our system. For more information, see:
PDCBloggers.net
TechEdBloggers.net
WinMoBlogs.net
DevDaysBloggers.net
Of those articles, we carefully selected nearly 4,000 of the best for our feeds. Those articles, written by the community for the community, have helped connect individuals and teams with the resources they need to build better software.
The Power of Blogs
There are generally two types of blogs: personal and group. Personal blogs are an individual's journal or diary, maintained and published on the Internet. Group blogs consist of a group of people writing about their experience surrounding a common interest. A friendly, conversational style is usual for both types. In addition, many blogs allow readers to post comments and respond to polls to increase community interactions.
Blogs offer developers a powerful new tool for gathering important technical information. You can learn compelling techniques from experts, discover valuable insights from your peers, and even encourage change by offering your comments about a product. Today, you must read blogs to keep ahead of the curve.
A frequent question is "Where do I start?" While an Internet search will return hundreds, if not thousands, of potential candidates, sifting through the results can be daunting. So, for your convenience, we summarized the "Best of the Blogs: Visual Studio Tools for Office, Version 2003."
Methodology
Our methodology for selecting the blog articles for this "Best of Visual Studio Tools for Office blogs" list was quite simple. We searched for blogs that mention Visual Studio Tools for Office in our own directory of bloggers and used popular search tools like Google and Feedster. Then, we analyzed the content of the blogs matching our criteria to reveal the articles providing what we believe is the best technical insight and information.
Blog Articles
We divided the blog articles into categories, and we introduce each article with a short paragraph describing the content of the entry.
Architecture of Visual Studio Tools for Office, Version 2003 Solutions Using Managed Code Extensions
This category contains blog articles from developers and architects who discuss how Visual Studio Tools for Office works. Also included are blog articles discussing how managed code works with Office documents.
Author: Kathleen McGrath
Summary: Word Bookmarks provide a way to mark a placeholder or to insert text at a specific point in a document. They can mark anything from an insertion point to a word to an entire paragraph or section in a document. This article explains how Bookmarks work and how to use them using the Word object model.
Author: Eric Carter
Summary: Visual Studio Tools for Office solutions share the same process with Word or Excel, so there are a few things to keep in mind in order to "play nice." Eric explains why it is important to keep this in mind when attempting to create configuration files for Word or Excel.
Author: Eric Carter
Summary: C# does not provide the same facility as Microsoft Visual Basic .NET for handling optional arguments in interop functions. Therefore, developers must make use of the Type.Missing object to handle optional arguments. Eric explains the proper way to pass missing arguments to the Office object model from C# and what happens behind the scenes.
Author: Peter Torr
Summary: The Visual Studio Tools for Office team chose to store solution assemblies in a folder called Project_bin. This article explains why this decision helps with solutions deployed to Web servers.
Author: Peter Torr
Summary: Visual Studio Tools for Office places project assemblies in different locations depending on how you create the project. You can create your project using a new document or an existing document. Peter explains where the assemblies build, where they load from, and what folders are added to the security policy.
Common Visual Studio Tools for Office Programming Tasks
This category contains blog articles from developers and architects who discuss common programming tasks, problems, and solutions when using Visual Studio Tools for Office.
Author: Kathleen McGrath
Summary: There is plenty of information about adding and using command bar buttons, but adding custom images to command bar buttons is not as straightforward. Kathleen walks through the task of adding images to command bar buttons using the Clipboard.
Author: Kathleen McGrath
Summary: This is a follow-up to Kathleen's previous article. It explains an alternative technique for adding images to command bar buttons. The Clipboard technique is an easy method for accomplishing the task, but it requires overwriting whatever information may already be on the Clipboard. The technique in this article uses the stdole2 library to convert the image and add it directly to the button.
Author: Paul Cornell
Summary: Paul provides a code example for accessing and controlling the Window object of an Excel workbook. He then discusses some of the issues that exist when you access the Windows collection and Window object from Visual Studio Tools for Office code.
Author: Paul Cornell
Summary: The Range object in Excel provides a one-based indexer into the cells contained in the Range. However, arrays in the .NET Framework are zero-based. Paul discusses some of the techniques he uses to translate and load cells into an Array object using Visual Studio Tools for Office code.
Author: Peter Torr
Summary: Visual Studio Tools for Office does not come with the ability to create Excel template projects; however, you can accomplish the same thing through the Excel Document project. Peter Torr explains why the Excel template project is not included in Visual Studio Tools for Office, and then he describes how to turn an Excel Document project into an Excel template.
Starting Visual Studio Tools for Office Development
This category contains blog articles about setup, project templates, Office primary interop assemblies, and other tasks relating to beginning development using Visual Studio Tools for Office.
Author: Julie Kremer
Summary: Julie describes the top five things she hates and the top five things she loves about Visual Studio Tools for Office. Peter Torr also suggests some solutions.
Author: Eric Carter
Summary: Eric describes how you can use Visual Studio Tools for Office today to begin building applications for Office, using your favorite Microsoft .NET language rather than Visual Basic for Applications (VBA). He also describes how you can write .NET code to interact with other Office applications, such as Microsoft Office Outlook 2003 and Microsoft Office PowerPoint 2003, using primary interop assemblies.
Author: Chris Kunicki
Summary: Why would you want to use Visual Studio Tools for Office to build applications for the Microsoft Office System? Chris explains why using Visual Studio .NET is more productive because of the rich IDE and the robustness of the .NET Framework class libraries.
Securing Visual Studio Tools for Office Solutions
This category contains blog articles about protecting Office solutions using the Microsoft .NET Framework security model and articles about defending against specific security threats.
Author: Paul Cornell
Summary: It is essential to understand the security settings of Visual Studio Tools for Office applications when deploying them to your end users. Paul provides a summary of some of the security documentation available on MSDN, giving a great overview of the things you need to be concerned about when deploying Visual Studio Tools for Office applications.
Author: Peter Torr
Summary: This article provides a detailed explanation of the Visual Studio Tools for Office security model. Peter explains how the Visual Studio Tools for Office team made some of the decisions they did, considering the security of Visual Studio Tools for Office applications.
Author: Peter Torr
Summary: Peter describes how to use referenced assemblies in Visual Studio Tools for Office solutions, the proper way to locate where they will load from, and how to register them for Full Trust with code access security (CAS). He explains why to use caspol.exe, instead of the .NET Framework wizards, to set up a security policy during development.
Author: Peter Torr
Summary: Peter describes why it is important not to throw away evidence of code access security, even if it is not granting permissions.
Author: Peter Torr
Summary: This article provides a registry file that adds two context menu items on DLLs, .exe files, and folders. One menu item adds the object to CAS policy with Full Trust. The second menu item removes the object from CAS policy.
Troubleshooting Visual Studio Tools for Office Solutions
This category contains blog articles with tips for solving common problems encountered when creating Office solutions using Visual Studio Tools for Office.
Author: Harry Miller
Summary: In this article, Harry explains why menus, toolbars, and forms might stop working in a Visual Studio Tools for Office solution. He includes a code sample that shows how to ensure that these elements continue to work while the solution is loaded.
Author: Eric Carter
Summary: Eric provides some advice on when to use and when not to use the ReleaseCOMObject method in Office development. Typically, you should not use ReleaseCOMObject in a Visual Studio Tools for Office solution. Eric explains why.
Author: Peter Torr
Summary: Peter delivers a detailed report on why the default security settings in Visual Studio Tools for Office do not allow Web service calls to work properly. He then describes a workaround to enable Web service calls from your Visual Studio Tools for Office solutions.
Author: Peter Torr
Summary: This article describes a scenario where exceptions cannot be caught. Then, it shows how to provide an extra layer in your Visual Studio Tools for Office applications so that the exceptions can be caught.
Excel Object Model and Visual Studio Tools for Office
This category contains blog articles about understanding and using the Excel object model.
Author: Kathleen McGrath
Summary: Kathleen shows how to handle change events for a named range using the Excel object model. She also includes a link to information about how this changed with Visual Studio Tools for Office, Version 2005.
Author: Kathleen McGrath
Summary: The GetSaveAsFileName method in the Excel object model provides several optional parameters that change the behavior of the Save As dialog box. In this article, Kathleen shows how to use these parameters and evaluate the response. She also proposes using the SaveFileDialog class in .NET as an alternate option. She also mentions some of the issues encountered with code access security when saving a document to another location.
Author: Paul Cornell
Summary: Paul points out that developers learning Visual Studio Tools for Office are often frustrated by the Office object model, due to the amount of objects and methods available. He shows how you can wrap the Excel object model in helper functions to simplify development against the object model.
Visual Studio Tools for Office Samples and Walkthroughs
This category contains blog articles about the code examples, sample applications, and systematic walkthroughs referenced in Microsoft documentation or other official Microsoft publications.
Author: Paul Cornell
Summary: This article describes how to create a simple task pane without having to implement the ISmartDocument interface. Although not a replacement for the task pane or the ISmartDocument interface, it shows a quick way to get similar functionality to a task pane, and demonstrates how to pass data between a document and a Microsoft Windows Form.
Author: Paul Cornell
Summary: Paul follows up on a previous article about how to create a task pane for Excel with an example of accomplishing the same idea with Word.
Author: Harry Miller
Summary: Harry describes the Visual Studio Tools for Office Training Labs available on MSDN. The labs include samples and walkthroughs for both Word and Excel solutions.
Author: Joe Andreshak
Summary: Joe points out some of the great information available in the Office 2003 Smart Tag SDK, including information on how to use the Visual Studio Tools for Office loader to load smart tags.
Author: Rohan Cragg
Summary: This article shows how to use one shared assembly from many different Word templates. The example includes information about issues encountered while implementing the solution.
Additional Resources
Visual Studio .NET and Office Development
Microsoft Office Developer Center: Visual Studio Tools for the Microsoft Office System
Visual Studio Tools for Office 2003 Blog
Visual Studio Tools for Office Newsgroup: microsoft.public.vsnet.vstools.office
About the Authors
Kevin Schuler is the chief strategy officer for Sagestone Consulting and a Microsoft Regional Director. He is an author of Microsoft technical books and white papers. He has participated in Visual Studio Tools for Office design reviews for Microsoft, along with leading a team that created Visual Studio Tools for Office code snippets and an example application for MSDN. He was instrumental in the creation and execution of Tech Ed Bloggers, PDC Bloggers, and other aggregated blog communities.
Drew Robbins, an architectural consultant with Sagestone Consulting, is a Microsoft Regional Director and an ASP.NET MVP. He is active in online communities as an editor for aggregated conference blogging sites, including Tech Ed Bloggers and PDC Bloggers. He also provides support to developers as chairperson of the .NET Developers Group in central Ohio, and as a volunteer for the International .NET Association (INETA).