MailMerge from Access 97 to Word 97, value lost 
Author Message
 MailMerge from Access 97 to Word 97, value lost

I want to MailMerge from Access 97 to Word 97, but a DialogBox ask me the
current value of the ID that I need to MailMerge. Maybe I lose the ID. Why?
Thanks.

Source code in VBA:
Private Sub Commande_MailMerge_Click()
    Const DOCname = "Document_mydoc.Doc"

On Error GoTo Err_Commande_MailMerge_Click

    Dim oApp As Object

    Set oApp = CreateObject("Word.Application")
    Set doc = oApp.documents.Open(Application.CurrentProject.Path & "\" &
DOCname)
    oApp.Visible = True
    Dbname = Application.CurrentDb.Name

    With doc.MailMerge

        .OpenDataSource Name:= _
                    Dbname, Connection:="QUERY R_publipostage_document"

        .Destination = wdSendToNewDocument
        .Execute

Exit_Commande_MailMerge_Click:
    Exit Sub

Err_Commande_MailMerge_Click:
    MsgBox Err.Description
    Resume Exit_Commande_MailMerge_Click

End With

  oApp.Quit savechanges:=False
    Exit Sub
Erreur:
    MsgBox Err.Description
    Exit Sub

End Sub

My request :
SELECT Tb_Document.Id_document,
FROM Tb_Document
WHERE
(((Tb_Document.Id_document)=[Formulaires]![For_document]![Id_document])) ;



Fri, 27 Dec 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Two problems with mailmerge from Access 97 to Word 97

2. Help Needed - Passing Value from Access 97 to Word 97 Macro

3. Access 97: Unbound controls lose value on requery.

4. Word 97 and Word 2000 VBA - Functionality Lost?

5. Access 97 create a Word 97 letter

6. Word (97) constants in Access (97)

7. Automation seems to hang with Access 97 / Word 97

8. Saving a Word 97 Document in a Access 97 table

9. Can you pass a table to Word 97 from Access 97

10. Open Word 97 from Access 97 HELP!!!

11. Automation Error when automating Word 97 from Access 97

12. Sending text to Word 97 from Access 97 using OLE automation

 

 
Powered by phpBB® Forum Software