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

Launching Word from Access and Inserting Fields from the Active Record

Status
Not open for further replies.

RickTX

IS-IT--Management
Oct 16, 2001
3
0
0
US
I am reposting this since I am now a registered user - hope it helps!

I am designing a contact management database - After I select a given record in my database, I need a command button to do the following:

launch Word

open a given Word document (my standard business letter template)

merge into Word the Name and Address of the individual selected in the Access database (the active record)

Any hints / code / advice would be greatly appreciated.

Thanks,

RickTX
 
Well... I don't have the time to do this, but I know how it can be done...

You can retrieve the values from the form just by accessing the value property of the form objects... like:
Me.txtMyTextbox.Value

Then you can go to msdn, or buy a book, and take a look at the word object model...

something like:

Dim m_appWd As New Word.Application
Dim m_docReport As New Word.Document

Sub CreateWordDocument()
Set m_docReport = m_appWd.Documents.add(Template:="pathtoyourtemplate", NewTemplate:=False)


End Sub

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top