Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This sample uses the WordApplication object to create a new Word document that displays nested salesperson/sales item data. The data for this demo comes from the AdventureWorks database. First, a query for a list of salespeople is executed and a table for each salesperson is created with a surrounding bookmark. Then, the document is opened as a WordTemplate object and the bookmarks for each sales person are bound and populated with sales line-item data. The end-result is a document that displays five sales line items for each employee in a nested format.

Code Block