Search Wiki:
This download provides the complete project files and source code for a sample invoice-creation tool implemented by using VSTO in Visual Studio 2008.

This sample provides an implementation of a specific business scenario involving Word. In this scenario, an employee of the fictitious Northwind company uses a VSTO-customized Word template to create copies of sales invoices for customers that have placed orders with the company.

The employee uses data-bound controls on the Document Actions task pane (also called the actions pane) to choose the company and the order details to add to a table in the document. Only a subset of the order details are added to the table; the full order details are added to custom XML parts that are embedded in the document. To control the text in the document, the template uses data-bound content controls. The customer that the document is addressed to and the table that contains the order details are enclosed in read-only content controls, and can be modified only by using controls on the task pane.

After the employee is finished with the document, they can click a button on the task pane to remove the VSTO customization from the document. This enables other customers to open the document without having to install the VSTO customization.

This sample illustrates the following tasks:
• Creating a Word template project for Word 2007, and adding text and data-bound content controls to the template that is hosted in the Visual Studio designer.
• Adding an actions pane to the template, and adding data-bound controls to the task pane.
• Using the object model of Word to add rows to a table in the document, and to add custom XML parts to the document.
• Removing the VSTO customization from the document after the employee is finished with it.

This sample requires Word 2007 and Visual Studio 2008.
Last edited May 5 2010 at 8:43 PM  by mcleans, version 9
Updating...
Page view tracker