Data-Bound Content Controls Sample
This sample runs only in Microsoft Office Word 2007.
This sample demonstrates how to bind content controls on a Word document to fields in a Microsoft Office Access database. Each content control on the document is bound to a different field in the Northwind sample database. The document also displays an actions pane that you can use to navigate through employee records, search for a specific employee record, and save changes that you make in one of the content controls to the database.
This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that concept. It may not meet the security requirements for a specific environment, and it should not be used exactly as shown. We recommend that you add security and error-handling code to make your projects more secure and robust. Microsoft provides this sample code "AS IS" with no warranties.
To run this sample
Verify that the content controls in the table display information about an employee named Nancy Davolio.
In the actions pane, click the Next and Previous buttons to view different employee records.
Verify that the content controls display information from the currently selected employee record.
In the actions pane, enter a number from 1 through 9 in the Input ID text box, and click the Search by ID button.
Verify that the content controls display information from the employee record that matches the ID.
Click in the cell to the right of the Title cell and type a new title for the current employee.
In the actions pane, click the Submit change to Title button to save the new title to the database.
Open the Northwind.mdb database in Access, and verify that the Title field of the employee has the new title.