Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a report in Word format programatically.

Status
Not open for further replies.

BrazilTechie

Programmer
Nov 13, 2002
88
BR
Is there any way I can create a report using Access straight to a Word format? What I have done is create the report using the "DoCmd.OpenReport" command and then converting it to a Word Format.
Please help!
 
Use Automation.
Basically, from Access:

Set myWrdApp=CreateObject("Word.Application")
'here you have full control over Word
'check the VBA for Word terminology, objects and methods

Set rst = CurrentDb.OpenRecordset("UnderlyingTableOrQuery")
'do whatever you need to do with data in the recordset

Set myWrdApp = Nothing

If you encounter errors, set a reference to Microsoft Word Object library.

It's much more work to do...but you can create the document exactly as you want it.

Good luck,
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top