Dave Burke : Freelance .NET Web Developer specializing in Online Communities

CC4 Notes: Visual Studio Tools for Office

Visual Studio Tools for Office

Robert Holmes

Robert is one of those crazy guys who did, like, 4 presentations at Code Camp 4.  This was his first, at 9:00 AM.  Robert had some COM-Exception/MSHandler issues preventing his examples to run, but a good introduction to VSTO 2005.

Now integrated into VS2005.  Was an add-on in VS2003.

.NET projects based on Office documents.

Because VSTO apps involve assemblies, we need to install the Office app (not copy and paste...)

Interacting with Office from within the .NET environment.  Two approaches: Old School Automation (open up Word inside of .NET) and Extensibility Projects (extending an Office document)

Extensibility—add new menu items with functionality, respond to events.

The connect class is main class of a Office extensibility project.

Protected Word.Applications wordApp = null;

Project Properties Debug.  What's it going to load to test itself?  Start external program in properties startup field, example: c:\office\msexcel.exe

Templates.  Use a new spreadsheet or an existing spreadsheet.  Work with the document directly within the 2.0 IDE.  Designer support on the project document.

According to Robert, VB is much easier for working in VSTO (little casting, less "complete object" access) than C#.

Add data connection.  "Opens up whole new worlds in Office."  Developers can leverage VSTO to save time on projects rather than building similar functionality in native .NET outside of Office.  Agreed.

Reminder to checkout the designer-created classes supporting the dataset to learn how functions are performed and to have greater control in generating by code apart from the designer.

Action Panes (task panes on right-hand side) are "no-brainers" to create.

VSTO has full access to Windows Forms.  Sweet.

Host Controls--Bookmarks, XmlNode, Named Range, Chart, etc...

Deployment requires a Setup project to .MSI.

This.actionpane.visible = true.
This.actionpane.controls.add...

The user sees a .doc, but Custom .doc properties will list the .NET assemblies in the GAC. 

Must install Office PIAs (Primary Interop Assemblies) to support VSTO applications. Optimized wrapper for COM objects.


 

Comments (0) | Post RSS RSS comment feed

Posted on 9/26/2005 1:43:00 PM by Dave Burke
Categories: .NET
Tags:

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke