linking to Word

  • Thread starter Thread starter Emmanuelle
  • Start date Start date
E

Emmanuelle

Hi,

I keep my contacts in Access in a form view. With the form
opened, how can I link with Microsoft Word so that when I
open Word, the details of the contact that are opened are
displayed in Word?
Thanks.


Emmanuelle
 
Emmanuelle said:
Hi,

I keep my contacts in Access in a form view. With the form
opened, how can I link with Microsoft Word so that when I
open Word, the details of the contact that are opened are
displayed in Word?
Thanks.


Emmanuelle

You need to place 'bookmarks' into the word document. From Access you open a
'Word' object and fill the bookmarks with the data on the form.

Code to do this could be behind a 'send to word' button. The code will be
something like....

With me
Set wdApp = New Word.Application
wdApp.Visible = True
Set wdDoc = wdApp.Documents.Add("t:\admin\templates\Rate
Confirmation.doc")

wdDoc.Bookmarks("Company").Range.Text = .lngClient.Column(1)
wdDoc.Bookmarks("Rate").Range.Text = .lngCurrency.Column(1) & .lngRate
& " " & .lngPeriod.Column(1)
End with

..... and so on.
 
Mr Bitsy,

Thanks, it's very helpful. I am not too familiar with code
writing, could you recommend a website where I could find
some information on it?
Thanks
-----Original Message-----


You need to place 'bookmarks' into the word document. From Access you open a
'Word' object and fill the bookmarks with the data on the form.

Code to do this could be behind a 'send to word' button. The code will be
something like....

With me
Set wdApp = New Word.Application
wdApp.Visible = True
Set wdDoc = wdApp.Documents.Add ("t:\admin\templates\Rate
Confirmation.doc")

wdDoc.Bookmarks("Company").Range.Text = .lngClient.Column(1)
wdDoc.Bookmarks("Rate").Range.Text
= .lngCurrency.Column(1) & .lngRate
 
I have a working sample, and I also have very good instructions on how to
implement the word merge in your application.

The sample code uses a real mail merge, and thus does not need book marks.

Also, by not using book marks, then my code is "general", which means you
don't have write a bunch of VB code.


The sample code I have will work with your EXISTING forms to allow a single
record merge to a word template. (and, only ONE LINE of code is needed to do
this for any form you have).

You can find my word merge example at:

http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html
 
Back
Top