O'Reilly logo

Access™ 2007 VBA Bible: For Data-Centric Microsoft® Office Applications by Helen Feddema

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Working with Word Documents and Templates

IN THIS CHAPTER

  • Office 2007 built-in Word export

  • Components of the Word object model used in Automation code

  • Creating Word documents filled with Access data, using four different methods

Despite the new and improved report interactive features discussed in the "Report Layout View" sidebar, for full control over the appearance and content of documents filled with Access data, VBA Automation code working with Word documents is the best choice. This chapter discusses producing Word documents by using a Ribbon command to create simple documents, or writing VBA Automation code to create Word documents and fill them with data, using four different methods.

In contrast to Access reports (even in the new Layout view), Word documents have extensive formatting options, including tables, form fields, and other specialized controls not available in Access reports, even in Layout view. Generating Word documents from Access VBA code lets you use all of Word's formatting options and (if desired) to create a separate document for each Access record, instead of a multi-page mail merge document. And the Word documents containing merged Access data can be edited, which is not an option even for Access 2007 reports.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required