Microsoft Office Tutorials and References
In Depth Information
Application-level solutions versus document-level solutions
Application-level solutions versus
VSTO 3.0 supports the creation of document-level solutions for Word, InfoPath,
and Excel. Document-level solutions provide a document pointing to very specific
tasks. The document-oriented approach can be used with documents in a uniform
template that needs to be managed inside a team or company without affecting the
application of the document that it resides in. For instance, a service business may
wish to automatically generate invoices based upon customer data pulled from an
An application object represents the whole application, whereas the document
object represents the single document. With the document object, a specific type of
document— in this example a programmatically created and filled-out invoice, is
required; no changes to the application are necessary.
VSTO 3.0 is capable of having an application-oriented approach for all of
the applications in the Office 2007 suite. You can implement a wide range of
functionalities and features to your Office application through add-ins.
The ability to create application-level solutions using .NET technology is one
of the key functionalities provided by the VSTO 3.0 for Office 2007 development.
An application-level solution is customization done specifically to suit the
application—in this case, Word 2007—and is available for all of the documents
used by this application. The Task Pane customization and Ribbon customization
are examples of application-level solutions that can be performed using VSTO.
These concepts are explained in detail later in this chapter. A Task Pane button
that generates our service business' invoice would appear in all instances of
Word and would create a new behavior for the Word application.
Creating document-level solutions
In this section, you're going to see a simple document-level customized solution
saying Hello world . This customization is specific to the document you've
customized; the Hello world message appears whenever the document is opened.
So every time you open this document, it displays the message. Even if you send
the same document to other users, and the user opens the same document on a
different machine running a different installation of Word 2007, the same message
will be displayed. This is because the solution is document-level, and it resides in
the document; the document being moved to a different location will not affect the
solution. If a new instance of Word 2007 is started with a blank document, the text is