Building COM Add-ins with Geoffrey L. Griffith
Ever wanted to extend Microsoft Office applications with custom functionality but weren't sure where to start?
In this comprehensive presentation, Geoffrey L. Griffith demonstrates how to create COM add-ins for Microsoft Office applications using Visual Studio Tools for Office (VSTO). The talk explores both the theory behind COM add-ins and provides practical demonstrations of creating a Word add-in that integrates Crystal Long's Document Property Editor. While the presentation focuses on Word, the concepts and techniques can be applied to other Office applications (with some notable exceptions for Access).
Whether you're an experienced developer looking to expand your skillset or simply curious about extending Office applications, this detailed walkthrough provides valuable insights into the world of COM add-in development.
Background and Experience
Speaker's Credentials
- Professional Access developer since 2000
- Former Microsoft Access team member (Access 2007)
- Co-authored three Access programming books with Wrox Press
- Bachelor's degree in Computer Science from University of Colorado
- Currently supports Access solutions through Imagine Thought
Technical Foundation
Understanding COM
- Component Object Model (COM) - legacy Microsoft technology from early 1990s
- Used extensively in Windows and Office applications
- Still supported but being phased out
- Original Office desktop applications were COM-based
COM Add-ins
- Collections of code implementing COM add-in event methods
- Can be application-independent
- Traditionally built in Visual C++ or pre-.NET Visual Basic
- Current development options:
- C++ with ATL (pure COM)
- .NET languages (C#, VB.NET) implementing COM methods
- twinBASIC [Editor's note: not mentioned in video]
Development Tools
Visual Studio Tools for Office (VSTO)
- Collection of libraries and templates for Office development
- Supports Excel, InfoPath, Outlook, PowerPoint, Project, and Word
- Notable exclusion: No direct support for Access
- Provides:
- Visual Studio project templates
- Debugging capabilities
- Add-in installers
- Registration handling
Development Requirements
- Microsoft Office 2013 or higher
- Visual Studio 2022 (Community Edition sufficient)
- VSTO components (Office/SharePoint development workload)
- Approximately 30GB disk space for installation
Implementation Example
Project Structure
- Solution files containing:
- Add-in code files (.cs or .vb)
- Designer files
- Ribbon XML
- Resources (images, etc.)
- Output includes:
- VSTO installer
- Debug files
- Manifests
- Core DLLs
Key Implementation Steps
- Create new VSTO project
- Add ribbon XML
- Implement required COM interface methods
- Add custom functionality
- Handle installation and registration
Technical Considerations
Architecture Independence
- .NET bytecode allows platform independence
- Single distribution package works for both x86 and x64
- Exception: Access-specific components still require separate builds
Integration Options
- COM-to-.NET integration straightforward
- .NET-to-COM requires additional consideration
- Primary Interop Assemblies (PIA) facilitate Office integration
Recording
The full recording is available on YouTube:
Join Live!
Want to get even more out of these presentations? Join the live Access User Group events! The next upcoming events are listed on the AUG Event Calendar.
Attending live gives you the opportunity to:
- Interact directly with presenters during Q&A sessions
- Network with other Access developers
- Share your own experiences and challenges
- Get immediate answers to your specific questions
- Participate in group discussions
With multiple user groups across different time zones (and languages!), you're sure to find a meeting time that works for your schedule.
Acknowledgements
- Base cover image generated by FLUX-schnell
- Initial draft generated by Claude-3.5-Sonnet