VSTO 3.0 for Office 2007 Programming

Book description

Get to grips with Programming Office 2007 using Visual Studio Tools for Office

  • A step-by-step guide for brand-new Office developers who want to explore programming with VSTO

  • Precise information on programming in Microsoft InfoPath, Word, Excel, PowerPoint, Outlook, Visio, and Project 2007 using VSTO

  • Create your own fully featured Office extensions

  • Packed with easy-to-follow examples covering all the Office applications

In Detail

With the arrival of Visual Studio Tools for Office 3.0 (VSTO), developers can now program Microsoft Office from the .NET framework. There are huge books in the market that give loads of unnecessary information but are of no real help to brand-new Office developers. Wouldn't it be great to have a precise book that simply covers the basics and introduces programming Office 2007 with VSTO using the latest version of Visual Studio? This is that book.

VSTO 3.0 for Office 2007 Programming shows you how to write Office 2007 applications with Visual Studio Tools for Office 3.0. Learn how to automate tasks in InfoPath, Word, Excel, Outlook, PowerPoint, Visio, and Project 2007 with greater programming power and flexibility than was available from the VBA language. With this book and the mastery of VSTO you will learn, Office will no longer be an application to you; it will be a platform for developing custom applications.

VSTO 3 is the most recent version of VSTO, making use of Visual Studio 2008, and working with Office 2007. This book shows how VSTO puts Office automation into the hands of developers, allowing them to use the power of the .NET framework to automate Office applications thus increasing the speed of the applications, their security, and the opportunity to use other parts of the .NET Framework such as its data handling capabilities.

This book builds a solid programming foundation in VSTO for brand-new Office developers. You will leave behind the world of VBA programming and take your first steps into the powerful and exciting world of using C# to create Office 2007 applications. Packed with examples and covering all the main Office applications, this book will have you creating fully featured Office extensions before you know it.

Table of contents

  1. VSTO 3.0 for Office 2007 Programming
    1. Table of Contents
    2. VSTO 3.0 for Office 2007 Programming
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. Preface
      1. What this book covers
      2. Who this book is for
      3. Conventions
      4. Reader feedback
      5. Customer support
        1. Downloading the example code for the book
        2. Errata
        3. Piracy
        4. Questions
    7. 1. Visual Studio Tools for Office (VSTO)
      1. What is Microsoft VSTO?
      2. Why VSTO 3.0?
        1. Safer managed code extensions
        2. Data caching
        3. Feature customization
        4. User Interface customization
        5. Smart tags
        6. WPF support
        7. Visual designers
        8. Security improvements
        9. Maintainability
      3. What's new in VSTO 3.0?
      4. VSTO architecture
        1. Development approaches
          1. Document-oriented approach
          2. Application-oriented approach
      5. VSTO development and deployment
      6. Creating Office applications through VSTO
        1. VSTO development environment
        2. Package
      7. Visual Studio integration
        1. Creating VSTO solutions
        2. Viewing IDE Windows
        3. Debugging
      8. What can we expect in the next version?
      9. Summary
    8. 2. Microsoft Office InfoPath Programming
      1. Microsoft Office InfoPath
      2. InfoPath 2007 in Visual Studio
      3. Visual Studio 2008 InfoPath solution overview
        1. The VSTO problem when installing Office InfoPath 2007
      4. Creating our first example
      5. Available customization features
            1. Data validation
            2. Custom actions on save
            3. Switching views
      6. Object model in InfoPath solution
        1. Understanding the Microsoft Office InfoPath object model
        2. Understanding the InfoPath object model functional area
            1. Application
            2. WindowCollection
            3. Window
            4. XmlFormCollection
            5. XmlForm
            6. View
            7. ViewInfoCollection
      7. Using events in InfoPath
        1. Form-level events
            1. An example of the solution xsi:nil="true" attribute
            2. Loading event
            3. Using the ViewSwitched event
            4. Using the ContextChanged event
            5. Using the Submit event
            6. Using the VersionUpgrade event
            7. Using the Save event
            8. Sign event
            9. Merge event
        2. Xml events
            1. Changed event
            2. Changing event
            3. Validating event
        3. Control events
            1. Clicked event
      8. Writing event validation for an expense report form
      9. Manipulating a data source
        1. Fetch node value from main data source
        2. Assigning a value to a node in the main data source
        3. Adding or creating a new node in the main data source
        4. Deleting or removing nodes from the main data source
        5. Populating Microsoft Office InfoPath with Microsoft SQL Server 2008
      10. Working with Custom Task Panes
        1. Managed code
        2. Custom Task Pane
        3. Creating an InfoPath Task Pane
        4. Creating an InfoPath add-in project using Visual Studio 2008
      11. InfoPath and SharePoint workflow
      12. Summary
    9. 3. Microsoft Office Word Programming
      1. Microsoft Office Word 2007 solutions
        1. Application-level solutions versus document-level solutions
        2. Creating document-level solutions
        3. Publishing solution deployment
      2. Working with objects and documents
            1. Application object
            2. Document object
            3. Range object
            4. Selection object
            5. Tables collection object
        1. Working with key objects
          1. Inserting text in Word 2007 document
          2. Selecting text in a Word 2007 document
          3. Creating a table in a Word 2007 document
          4. Working with Word templates
      3. Actions Pane: Document-level customization
        1. Creating a Custom Actions Pane for Microsoft Office Word 2007
          1. Managing the Actions Pane
          2. Designing the Actions Pane
      4. Application-level solutions
        1. Task Pane: Application-level customization
        2. What is the Task Pane?
        3. Custom Task Pane
          1. Creating a Custom Task Pane for Microsoft Office Word 2007
      5. Programming in Word
        1. Word host items
        2. Word host controls
        3. Adding controls to a document
          1. Adding an ActiveX control to Microsoft Office Word 2007 programmatically
          2. Data binding to host controls
            1. Simple data binding
            2. Complex data binding
        4. What is LINQ?
          1. Using LINQ in Word 2007 with VSTO 3.0 and Visual Studio 2008
      6. Customization
        1. Ribbon menu
        2. Adding controls to menus
        3. Toolbar (Quick Access Toolbar)
          1. Adding controls to toolbars
      7. Summary
    10. 4. Microsoft Office Excel Programming
      1. Programming in Excel
        1. Hello World example using Visual Studio 2008
      2. Manipulation
        1. Data manipulation
          1. Reading worksheet cells
          2. Opening a text file as a workbook using VSTO
          3. Connecting with Microsoft SQL Server 2008 database
        2. Worksheet manipulation
      3. Working with ranges
        1. Cells
        2. Unions
        3. Named ranges
      4. Excel host items
        1. The workbook host item
        2. The worksheet host item
        3. The ChartSheet host item
      5. Excel host controls
        1. Chart control
        2. The ListObject control
        3. The NamedRange control
        4. The XMLMappedRange control
        5. The SelectionChange event
      6. Creating Excel smart tags with VSTO
      7. Excel formulae
      8. Regular expressions
      9. Excel data protection
        1. Workbook protection
        2. Worksheet protection
      10. Summary
    11. 5. Microsoft Office Outlook Programming
      1. Microsoft Office Outlook object model overview
      2. Customization using VSTO
        1. Menus in Outlook
        2. Toolbars in Outlook
      3. Outlook form regions support
      4. Manipulation
        1. Folders
        2. Contacts
        3. Email messages
      5. Working with Appointments
      6. Working with meetings
      7. Creating a Ribbon menu for Outlook 2007
      8. Outlook 2007 data interaction with Microsoft SQL Server 2008
      9. Summary
    12. 6. Microsoft Office PowerPoint, Visio, and Project Programming
      1. Programming PowerPoint 2007
        1. PowerPoint 2007 object model
        2. Creating a presentation at runtime
          1. Dynamically add a slide and set title text in the presentation
          2. Set the presentation theme
        3. Ribbons in PowerPoint
          1. Ribbon Visual Designer
          2. Creating a Ribbon
      2. Programming Visio 2007
        1. Visio 2007 object model
        2. Dynamically creating a new Visio document
          1. Adding shapes to a document at runtime
          2. Adding a page as a background for another page
        3. Set the document theme
        4. Creating a Commandbar
      3. Programming Project 2007
        1. Creating a Project and adding a task dynamically
        2. Creating menus for Microsoft Project
        3. Creating a Commandbar for Microsoft Project
      4. Summary
    13. Index

Product information

  • Title: VSTO 3.0 for Office 2007 Programming
  • Author(s): Vivek Thangaswamy
  • Release date: March 2009
  • Publisher(s): Packt Publishing
  • ISBN: 9781847197528