Welcome to VSTO 3.0 for Office 2007 Programming. This book covers Visual Studio Tools for Office programming, with a primary emphasis on the several new VSTO programming features available for Microsoft Office 2007. VSTO is a phenomenon that means different things to different people. This book introduces developers to VSTO as a platform for developing enterprise solutions based on Microsoft Office application.
This book covers Microsoft VSTO objects for Microsoft Office applications such as Word, Excel, PowerPoint, Visio, Outlook, and Project, which can be a significant challenge for the typical VBA developer—one set of target readers for this book. This book is focused more on the features of VSTO and how to work with the heavily-built Office object models. Although you might not be familiar with .NET programming, this book will help you to adapt easily to the new VSTO with .NET programming environment.
VSTO brings the Office applications to the .NET programming world. With VSTO 3.0, you can create add-ins for the six Microsoft Office applications, customize the Ribbon feature of the Microsoft Office 2007 suite, and create application-level custom task panes. This book strives to follow the same model. It explains VSTO’s concepts and basic programming in a way that helps beginners to get started and helps advanced users to get better. In addition to this, the book includes chapters for all of the Office applications, which describe how the programming and customization works, what its requirements are, and how it will simplify typical tasks.
Chapter 1 provides a panoramic overview of Visual Studio Tools for Office. This chapter provides you with a firm grounding in what VSTO really is. We look at how VSTO addresses the Microsoft Office 2007 customization area, its feature set, and its architecture.
Chapter 2 starts by explaining the object model and programming approach in InfoPath 2007. We then take a look at how we can customize InfoPath with Visual Studio 2008. The later part of the chapter explains how to work on task pane creation, development of add-ins, and so on.
Chapter 3 begins with a description of creating a Word solution using Visual Studio 2008, and as we move further, the chapter explains how to create document-level solutions and application-level solutions. It then explains the deployment process. It also covers key Word objects, with examples of how to work with SQL data manipulation, and so on.
Chapter 4 takes a look at working with Excel objects, and covers key objects with example solutions. It focuses on explaining host items and host controls and provides examples of some common solutions. It also gives you an idea of worksheet protection, smart tags, charts, and so on, with the help of examples.
Chapter 5 starts the chapter with an overview of Outlook objects and moves on to Outlook folder manipulation, mail item processing and working with meetings and appointments. In the later part of the chapter, we work with Ribbon customization for Outlook, with examples and many such customizations for Outlook.
Chapter 6 covers three Office applications: PowerPoint, Visio, and Project. Here, we work with shapes in Visio, Ribbon customization for PowerPoint, and dynamic project item manipulation, and so on.
This book is aimed at .NET developers who are familiar with C# and who want to get to grips with programming Office 2007. The book will also be useful for people who already have experience with VBA and programming Office, but are ready to take the next step into the more powerful world of Office programming with VSTO.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "Zack used the AfterNewPresentation
event and developed a solution for it".
A block of code will be set as follows:
private void ThisAddIn_Startup(object sender, System.EventArgs e) { // Creating PowerPoint presentation with single slide in it // Using the PowerPoint object instance adding the // Slide with text title structure to the current Presentation PowerPoint.Presentation PacktPresentation = this.Application. Presentations.Add(Microsoft.Office.Core.MsoTriState. msoTriStateMixed); }
New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "As it can be seen in the following screenshot, Say Hello World is displayed in a message box:".
Note
Warnings or important notes appear in a box like this.
Note
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an email to <[email protected]>
, making sure that you mention the book title in the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note via the SUGGEST A TITLE form on www.packtpub.com, or send an email to <[email protected]>
.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Visit http://www.packtpub.com/files/code/7528_Code.zip to directly download the example code.
Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide the location address or website name immediately, so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of this book, and we will do our best to address it.