We can create a similar data-bound document in Word using bookmarks rather than named ranges and a data grid rather than an Excel List object. Create a new Word document project and again add the Northwind database as a data source to the Data Sources pane. Visual Studio should remember the connection string from last time, so you will not need to configure it again.
Figure 17-11. A data-bound master-detail Word document in the designer.
Unfortunately, in this version of VSTO, there is no way to bind a data table to a Word table as you can with an Excel list object.
When we build and run the customized Word document, again we have a master-detail view of a data table running in Word without writing a single line of code.
Figure 17-12. The master-detail view at runtime.
Part One. An Introduction to VSTO
An Introduction to Office Programming
Introduction to Office Solutions
Part Two. Office Programming in .NET
Working with Excel Events
Working with Excel Objects
Working with Word Events
Working with Word Objects
Working with Outlook Events
Working with Outlook Objects
Introduction to InfoPath
Part Three. Office Programming in VSTO
The VSTO Programming Model
Using Windows Forms in VSTO
Working with Actions Pane
Working with Smart Tags in VSTO
VSTO Data Programming
Server Data Scenarios
.NET Code Security
Part Four. Advanced Office Programming
Working with XML in Excel
Working with XML in Word
Developing COM Add-Ins for Word and Excel
Creating Outlook Add-Ins with VSTO