Microsoft Office Tutorials and References
In Depth Information
Exporting Data to Excel
Figure 1-7:
The final
merged
document in
Word.
Just like the Outlook object library, the Word object library contains many
more properties and methods that allow you to control Word as though you
were clicking the various Ribbon commands and typing in the Word window.
For assistance on all of these commands, use the Object Browser (choose
View Object Browser or press F2 in Visual Basic Editor).
Exporting Data to Excel
Many Office users who are familiar with Excel just don’t understand the
power and flexibility of Access, and many executives are used to viewing
and printing tables of data from an Excel spreadsheet. So even though you’re
convinced that everyone in your organization (and, perhaps, the world)
should use Access instead of Excel, you’ll still come across quite a few
people who’d rather see the data in Excel than open an Access database.
Sure, you can export data to Excel (or other formats) from the Export group
on the External Data tab, but that task requires one of those pesky humans
to know what to do. As a compromise, you can automate the process by
writing VBA code to export the data — and do several formatting tasks as well.
Adding the export button and code
Pretend that you’re going to create a spreadsheet of phone numbers in the
Customer table. You also want to add a meaningful title that includes the
Search JabSto ::




Custom Search