text.skipToContent text.skipToNavigation
  1. Home
  2. Computer Science & IT
  3. Visual Studio Tools for Office 2007: VSTO for Excel, Word, and Outlook

Visual Studio Tools for Office 2007: VSTO for Excel, Word, and Outlook, 1st edition

  • Eric Carter
  • Eric Lippert

Published by Addison-Wesley Professional (February 24th 2009) - Copyright © 2009

1st edition

Chosen format
View all
Visual Studio Tools for Office 2007: VSTO for Excel, Word, and Outlook

ISBN-13: 9780132800464

Includes: Instant Access

This product is not available in your country

What's included

  • Instant Access

    You'll get instant access to the digital content.


Visual Studio Tools for Office 2007: VSTO for Excel, Word, and Outlook is the definitive book on VSTO 2008 programming, written by the inventors of the technology. VSTO is a set of tools that allows professional developers to use the full power of Microsoft Visual Studio 2008 and the .NET Framework to program against Microsoft Office 2007.


This book delivers in one place all the information you need to succeed using VSTO to program against Word 2007, Excel 2007, and Outlook 2007, and provides the necessary background to customize Visio 2007, Publisher 2007, and PowerPoint 2007. It introduces the Office 2007 object models, covers the most commonly used objects in those object models, and will help you avoid the pitfalls caused by the COM origins of the Office object models. Developers who wish to program against Office 2003 should consult Carter and Lippert’s previous book, Visual Studio Tools for Office.


In VSTO 2008, you can build add-ins for all the major Office 2007 applications, build application-level custom task panes, customize the new Office Ribbon, modify Outlook’s user interface using Form Regions, and easily deploy everything you build using ClickOnce.


Carter and Lippert cover their subject matter with deft insight into the needs of .NET developers learning VSTO, based on the deep knowledge that comes from the authors’ unique perspective of living and breathing VSTO for the past six years. This book 

  • Explains the architecture of Microsoft Office programming and introduces the object models
  • Covers the main ways Office applications are customized and extended
  • Explores the ways of customizing Excel, Word, and Outlook, and plumbs the depths of programming with their events and
    object models
  • Introduces the VSTO programming model
  • Teaches how to use Windows Forms and WPF in VSTO and how to work with the Document Actions Pane and application-level task panes
  • Delves into VSTO data programming and server data scenarios
  • Teaches ClickOnce VSTO deployment

This is the one book you need to succeed in programming against Office 2007.

C# and Visual Basic .NET Code samples for download can be found here: http://www.informit.com/store/product.aspx?isbn=0321533216

Table of contents

Figures xxxi

Tables xlv

Foreword li

Preface lv

Acknowledgments lix

About the Authors lxi


Part I: An Introduction to VSTO 1


Chapter 1: An Introduction to Office Programming 3

Why Office Programming? 3

Office Business Applications 3

Office Object Models 7

Properties, Methods, and Events 14

The Office Primary Interop Assemblies (PIAs) 39

Conclusion 48


Chapter 2: Introduction to Office Solutions 51

The Three Basic Patterns of Office Solutions 51

Office Automation Executables 54

Office Add-Ins 69

Code Behind a Document 78

Conclusion 86


Part II: Office Programming in .NET 87


Chapter 3: Programming Excel 89

Ways to Customize Excel 89

Programming User-Defined Functions 98

Introduction to the Excel Object Model 108

Conclusion 112


Chapter 4: Working with Excel Events 115

Events in the Excel Object Model 115

Conclusion 162


Chapter 5: Working with Excel Objects 163

Working with the Application Object 163

Working with the Workbooks Collection 178

Working with the Workbook Object 181

Working with the Worksheets, Charts,

Working with Document Properties 192

Working with the Windows Collections 195

Working with the Window Object 199

Working with the Names Collection and Name Object 202

Working with the Worksheet Object 204

Working with the Range Object 219

Special Excel Issues 235

Conclusion 241


Chapter 6: Programming Word 243

Ways to Customize Word 243

Programming Research Services 249

Introduction to the Word Object Model 261

Conclusion 262


Chapter 7: Working with Word Events 267

Events in the Word Object Model 267

Events in Visual Studio Tools for Office 307

Conclusion 310


Chapter 8: Working with Word Objects 311

Working with the Application Object 311

Working with the Dialog Object 332

Working with Windows 338

Working with Templates 341

Working with Documents 343

Working with a Document 348

Working with the Range Object 369

Working with Bookmarks 392

For teachers

All the material you need to teach your courses.

Discover teaching material