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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output Table Data to MS Word Document 1

Status
Not open for further replies.

chris3942

Technical User
Jul 2, 2003
17
US
MS Word does a terrible job with Mailing Labels Using Mail Merge (Leaves Multiple minimized versions of Access open, etc). In Access, with a table open, there's a menu Selection: Tools/Office Links/MS Word that allows me to dump the data into the pre-defined Word Document to print labels. How can this be automated using VBA or a Macro get to the point that the MS Word document opens? Users don't have access to the tables so I need a way to automate around the opening of the table.
 
try the following:

1 create a new macro
2 in the action column select OutputTo
3 at the bottom be sure to fill in the desired options
4 select your table from the Object Name list
5 to send it to Word choose Rich Text Format (*.rtf) in the Output Format field
6 in the Output File field I think you can specify the name of your file at the end of the path
(i.e. C:\YourFileName.doc).
7 be sure to set Auto Start to Yes so that the document will open automatically
8 Save the macro
9 To run the macro from code enter the following in your commmand button On Click event:

DoCmd.RunMacro "YourMacroNameGoesHere"

If the OutputTo action does not work for you, try the TransferText action. It is very similar to OutputTo.

hope this helps you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top