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

Pass access info to a word Doc

Status
Not open for further replies.

marcds

IS-IT--Management
Nov 20, 2002
1
US
Here si the basic situation my company prints up multiple docs per client.

At present we have a mail merge between word and our access database. We open the mail merge doc use the find in field command search for the user name and then when we find it select it and populate all the fields.

Here is what I want to do.

I want to have access open to one of our clients and there to be a command button that I click on and then the word document is printed with the information taken from our clients database table ie: Name field populates <<name>> on the mail merge doc

Here is the nut and bolts of what I am using


Private Sub PrintDoc_Click()
Dim WordObj As Object
Me![OLEObj].Verb = -2 'opens app
Me![OLEObj].Action = 7 'acctivates the app
Set WordObj = Me![OLEObj].Object.Application
WordObj.PrintOut Background:=False
WordObj.Quit
Set WordObj = Nothing

End Sub

Obviously I need a lot more than that.

I am a VBA neophyte any ideas?

Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top