Visual Studio Tools for Office: Using C# with Excel, Word, Outlook, and InfoPath

Paperback (Print)
Used and New from Other Sellers
Used and New from Other Sellers
from $1.99
Usually ships in 1-2 business days
(Save 96%)
Other sellers (Paperback)
  • All (13) from $1.99   
  • New (6) from $44.14   
  • Used (7) from $1.99   

Overview

"With the application development community so focused on the Smart Client revolution, a book that covers VSTO from A to Z is both important and necessary. This book lives up to big expectations. It is thorough, has tons of example code, and covers Office programming in general terms— topics that can be foreign to the seasoned .NET developer who has focused on ASP.NET applications for years. Congratulations to Eric Lippert and Eric Carter for such a valuable work!"

—Tim Huckaby, CEO, InterKnowlogy, Microsoft regional director

"This book covers all of the ins and outs of programming with Visual Studio Tools for Office in a clear and concise way. Given the authors' exhaustive experiences with this subject, you can't get a more authoritative description of VSTO than this book!"

—Paul Vick, technical lead, Visual Basic .NET, Microsoft Corporation

"Eric and Eric really get it. Professional programmers will love the rich power of Visual Studio and .NET, along with the ability to tap into Office programmability. This book walks you through programming Excel, Word, InfoPath, and Outlook solutions."

—Vernon W. Hui, test lead, Microsoft Corporation

"This book is an in-depth, expert, and definitive guide to programming using Visual Studio Tools for Office 2005. It is a must-have book for anyone doing Office development."

—Siew Moi Khor, programmer/writer, Microsoft Corporation

"We don't buy technical books for light reading; we buy them as a resource for developing a solution. This book is an excellent resource for someone getting started with Smart Client development. For example, it is common to hear a comment along the lines of, 'It is easy to manipulate the Task Pane in Office 2003 using VSTO 2005,' but until you see something like the example at the start of Chapter 15, it is hard to put 'easy' into perspective. This is a thorough book that covers everything from calling Office applications from your application, to building applications that are Smart Documents. It allows the traditional Windows developer to really leverage the power of Office 2003."

—Bill Sheldon, principal engineer, InterKnowlogy, MVP

"Eric Carter and Eric Lippert have been the driving force behind Office development and Visual Studio Tools for Office 2005. The depth of their knowledge and understanding of VSTO and Office is evident in this book. Professional developers architecting enterprise solutions using VSTO 2005 and Office System 2003 now have a new weapon in their technical arsenal."

—Paul Stubbs, program manager, Microsoft Corporation

"This book is both a learning tool and a reference book, with a richness of tables containing object model objects and their properties, methods, and events. I would recommend it to anyone considering doing Office development using the .NET framework; especially people interested in VSTO programming."

—Rufus Littlefield, software design engineer/tester, Microsoft Corporation

Visual Studio Tools for Office is both the first and the definitive book on VSTO 2005 programming, written by the inventors of the technology. VSTO is a set of tools that allow professional developers to use the full power of Visual Studio .NET and the .NET Framework to put code behind Excel 2003, Word 2003, Outlook 2003, and InfoPath 2003. VSTO provides functionality never before available to the Office developer: data binding and data/view separation, design-time views of Excel and Word documents inside Visual Studio, rich support for Windows Forms controls in a document, the ability to create custom Office task panes, server-side programming support against Office, and much more.

Carter and Lippert cover their subject matter with deft insight into the needs of .NET developers learning VSTO. This book

  • Explains the architecture of Microsoft Office programming and introduces the object models
  • Teaches the three basic patterns of Office solutions: Office automation executables, Office add-ins, and code behind a document
  • Explores the ways of customizing Excel, Word, Outlook, and InfoPath, and plumbs the depths of programming with their events and object models
  • Introduces the VSTO programming model
  • Teaches how to use Windows Forms in VSTO and how to work with the Actions Pane
  • Delves into VSTO data programming and server data scenarios
  • Explores .NET code security and VSTO deployment

Advanced material covers working with XML in Word and Excel, developing COM add-ins for Word and Excel, and creating Outlook add-ins with VSTO.

Read More Show Less

Product Details

  • ISBN-13: 9780321334886
  • Publisher: Addison-Wesley
  • Publication date: 9/28/2005
  • Series: Microsoft Windows Development Series
  • Pages: 1008
  • Product dimensions: 6.90 (w) x 9.00 (h) x 1.90 (d)

Meet the Author

ERIC CARTER is a lead developer on the Visual Studio Tools for Office (VSTO) team at Microsoft. He helped invent, design, and implement many of the features that are in VSTO today. Previously at Microsoft he worked on Visual Studio for Applications, the Visual Studio Macros IDE, and Visual Basic for Applications for Office 2000 and Office 2003.

ERIC LIPPERT'S primary focus during his nine years at Microsoft has been on improving the lives of developers by designing and implementing useful programming languages and development tools. He has worked on the Windows Scripting family of technologies and, most recently, Visual Studio Tools for Office.

Read More Show Less

Read an Excerpt

Preface

In 2002, the first release of Visual Studio .NET and the .NET Framework was nearing completion. A few of us at Microsoft realized that Office programming was going to miss the .NET wave unless we did something about it.

What had come before was Visual Basic for Applications (VBA), a simple development environment integrated into all the Office applications. Each Office application had a rich object model that was accessed via a technology known as COM. Millions of developers identified themselves as "Office developers" and used VBA and the Office COM object models to do everything from automating repetitive tasks to creating complete business solutions that leveraged the rich features and user interface of Office. These developers realized that their users were spending their days in Office. By building solutions that ran inside of Office, they not only made their users happy, they were also able to create solutions that did more and cost less by reusing functionality already available in the Office applications.

Unfortunately, because of some limitations of VBA, Office programming was starting to get a bad rap. Solutions developed in VBA by small workgroups or individuals would gain momentum and a professional developer would have to take them over and start supporting them. To a professional developer, the VBA environment felt simple and limited, and of course, it enforced a single language: Visual Basic. VBA embedded code in every customized document, which made it hard to fix bugs and update solutions because a bug would get replicated in documents across the enterprise. Security weaknesses in the VBA model led to a rash of worms and macro viruses that made enterprises turn VBA off.

Visual Studio .NET and the .NET Framework provided a way to address all these problems. A huge opportunity existed to not only combine the richness of the new .NET Framework and developer tools with the powerful platform that Office has always provided for developers but to also solve the problems that were plaguing VBA. The result of this realization was Visual Studio Tools for Office (VSTO).

The first version of VSTO was simple, but it accomplished the key goal of letting professional developers use the full power of Visual Studio .NET and the .NET Framework to put code behind Excel 2003 and Word 2003 documents and templates. It let professional developers develop Office solutions in VB.NET and C#. It solved the problem of embedded code by linking a document to a .NET assembly instead of embedding it in the document. It also introduced a new security model that used .NET code-access security to prevent worms and macro viruses.

The second version of VSTO, known as VSTO 2005, the version of VSTO covered by this book, is even more ambitious. It brings with it functionality never available to the Office developer before, such as data binding and data/view separation, design-time views of Excel and Word documents inside Visual Studio, rich support for Windows Forms controls in the document, the ability to create custom Office task panes, server-side programming support against Office—and that's just scratching the surface. Although the primary target of VSTO is the professional developer, this does not mean that building an Office solution with VSTO is rocket science. VSTO makes it possible to create very rich applications with just a few lines of code.

This book tries to put into one place all the information you need to succeed using VSTO to program against Word 2003, Excel 2003, Outlook 2003, and InfoPath 2003. It introduces the Office object models and covers the most commonly used objects in those object models. In addition, this book will help you avoid some pitfalls that result from the COM origins of the Office object models.

This book also provides an insider view of all the rich features of VSTO. We participated in the design and implementation of many of these features. We can therefore speak from the unique perspective of living and breathing VSTO for the past three years. Programming Office using VSTO is powerful and fun. We hope you enjoy using VSTO as much as we enjoyed writing about it and creating it.

Eric Carter Eric Lippert

May 2005

© Copyright Pearson Education. All rights reserved.

Read More Show Less

Table of Contents

About the Authors.

Preface.

Acknowledgments.

Foreword.

I. AN INTRODUCTION TO VSTO.

1. An Introduction to Office Programming.

2. Introduction to Office Solutions.

II. OFFICE PROGRAMMING IN .NET.

3. Programming Excel.

4. Working with Excel Events.

5. Working with Excel Objects.

6. Programming Word.

7. Working with Word Events.

8. Working with Word Objects.

9. Programming Outlook.

10. Working with Outlook Events.

11. Working with Outlook Objects.

12. Introduction to InfoPath.

III. OFFICE PROGRAMMING IN VSTO.

13. The VSTO Programming Model.

14. Using Windows Forms in VSTO.

15. Working with Actions Pane.

16. Working with Smart Tags in VSTO.

17. VSTO Data Programming.

18. Server Data Scenarios.

19. .NET Code Security.

20. Deployment.

IV. ADVANCED OFFICE PROGRAMMING.

21. Working with XML in Excel.

22. Working with XML in Word.

23. Developing COM Add-Ins for Word and Excel.

24. Creating Outlook Add-Ins with VSTO.

Index.

Read More Show Less

Preface

In 2002, the first release of Visual Studio .NET and the .NET Framework was nearing completion. A few of us at Microsoft realized that Office programming was going to miss the .NET wave unless we did something about it.

What had come before was Visual Basic for Applications (VBA), a simple development environment integrated into all the Office applications. Each Office application had a rich object model that was accessed via a technology known as COM. Millions of developers identified themselves as "Office developers" and used VBA and the Office COM object models to do everything from automating repetitive tasks to creating complete business solutions that leveraged the rich features and user interface of Office. These developers realized that their users were spending their days in Office. By building solutions that ran inside of Office, they not only made their users happy, they were also able to create solutions that did more and cost less by reusing functionality already available in the Office applications.

Unfortunately, because of some limitations of VBA, Office programming was starting to get a bad rap. Solutions developed in VBA by small workgroups or individuals would gain momentum and a professional developer would have to take them over and start supporting them. To a professional developer, the VBA environment felt simple and limited, and of course, it enforced a single language: Visual Basic. VBA embedded code in every customized document, which made it hard to fix bugs and update solutions because a bug would get replicated in documents across the enterprise. Security weaknesses in the VBA model led to a rash of worms and macro viruses that made enterprises turn VBA off.

Visual Studio .NET and the .NET Framework provided a way to address all these problems. A huge opportunity existed to not only combine the richness of the new .NET Framework and developer tools with the powerful platform that Office has always provided for developers but to also solve the problems that were plaguing VBA. The result of this realization was Visual Studio Tools for Office (VSTO).

The first version of VSTO was simple, but it accomplished the key goal of letting professional developers use the full power of Visual Studio .NET and the .NET Framework to put code behind Excel 2003 and Word 2003 documents and templates. It let professional developers develop Office solutions in VB.NET and C#. It solved the problem of embedded code by linking a document to a .NET assembly instead of embedding it in the document. It also introduced a new security model that used .NET code-access security to prevent worms and macro viruses.

The second version of VSTO, known as VSTO 2005, the version of VSTO covered by this book, is even more ambitious. It brings with it functionality never available to the Office developer before, such as data binding and data/view separation, design-time views of Excel and Word documents inside Visual Studio, rich support for Windows Forms controls in the document, the ability to create custom Office task panes, server-side programming support against Office—and that's just scratching the surface. Although the primary target of VSTO is the professional developer, this does not mean that building an Office solution with VSTO is rocket science. VSTO makes it possible to create very rich applications with just a few lines of code.

This book tries to put into one place all the information you need to succeed using VSTO to program against Word 2003, Excel 2003, Outlook 2003, and InfoPath 2003. It introduces the Office object models and covers the most commonly used objects in those object models. In addition, this book will help you avoid some pitfalls that result from the COM origins of the Office object models.

This book also provides an insider view of all the rich features of VSTO. We participated in the design and implementation of many of these features. We can therefore speak from the unique perspective of living and breathing VSTO for the past three years. Programming Office using VSTO is powerful and fun. We hope you enjoy using VSTO as much as we enjoyed writing about it and creating it.

Eric Carter
Eric Lippert

May 2005

© Copyright Pearson Education. All rights reserved.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 2 Customer Reviews
  • Anonymous

    Posted August 28, 2006

    Worthless for Word

    If you just want to switch from VB to C# and are looking for a good how to reference this is not the book for you especially as it pertains to Microsoft Word. There is a solid description and how to for the Range object, but that¿s about it. Word¿s Bulleted/Numbered List object, arguably the most convoluted of them all, doesn¿t even get mentioned and tables are glossed over in barely 2 pages.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted October 18, 2005

    a tying together of C# with MS Office

    This book ties together two longstanding traits of Microsoft, that long predate C# or .NET. The first is its Office suite, which is one of its main moneyspinners. The second is its tradition, going back to the early 80s, if not earlier, for writing nice development tools for programmers. Undoubtedly, when Microsoft devised C#/.NET a few years ago, the abilities given in this book would have been a major goal. The book promises a synergy between C# and Office. The attraction is of course the huge user base for Office. To this ends, the book describes many ways to open up Office to programmatic control and customisation. The code examples don't even seem all that hard, conceptually. No doubt, they were well chosen for this reason. The size of the book reflects its natural division. There are sections that correspond to the components of Office- Excel, Word, Outlook. There is also an extended foray into the use of the Visual Studio environment in which to write your C# code. Open source proponents might decry this further lockin of a developer into Microsoft's arms. But if you are willing to put up with that, it has to be said that Microsoft does provide a lot of support.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 2 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)