Yes. That's code from the Access VBA using MS Word 9.0
Object Library. Also shoudl have said that the code works
fine in Access 2000. I'll post this problem in the Acess
area.
I can only repeat what I said before, there is nothing at all in that code
that has anything to do with mailmerge.

Signature
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.
Hope this helps,
Doug Robbins - Word MVP
> Yes. That's code from the Access VBA using MS Word 9.0
> Object Library. Also shoudl have said that the code works
[quoted text clipped - 41 lines]
>>
>>.
Virgil - 09 Feb 2005 15:25 GMT
I'm not sure what your point is because this is actual VBA
code from an Access 2000 function which DOES execute a
mail merge in a Word 2000 document using an Excel
spreadsheet. It based on code from Helen Feddema's
book "Expert One-on-One Microsoft Access Application
Development". Now this same code doesn't work in
Access/Word 2003 and I'm trying to find out what changes
to make to make it execute a mail merge rather that just
give me a new document that hasn't been merged with the
data source.
>-----Original Message-----
>I can only repeat what I said before, there is nothing at all in that code
[quoted text clipped - 47 lines]
>
>.
Doug Robbins - 10 Feb 2005 00:23 GMT
I cannot explain why it may have worked in Word 2000. However, in all
versions of Word since Word 97, I would expect to see code something like
that which is included n the following exerpt from the Visual Basic Help
file:
Returns a MailMerge object that represents the mail merge functionality for
the specified document. Read-only.
Note The MailMerge object is available regardless of whether the specified
document is a mail merge main document. Use the State property to determine
the current state of the mail merge operation.
Example
This example executes a mail merge if the active document is a main document
with an attached data source.
Set myMerge = ActiveDocument.MailMerge
If myMerge.State = wdMainAndDataSource Then myMerge.Execute
This example merges the main document with data records 1 through 4 and
sends the merge documents to the printer.
With ActiveDocument.MailMerge
.DataSource.FirstRecord = 1
.DataSource.LastRecord = 4
.Destination = wdSendToPrinter
.SuppressBlankLines = True
.Execute
End With
There is nothing at all in the code that you have posted that refers to
Mailmerge.That is my point.

Signature
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.
Hope this helps,
Doug Robbins - Word MVP
> I'm not sure what your point is because this is actual VBA
> code from an Access 2000 function which DOES execute a
[quoted text clipped - 72 lines]
>>
>>.