none
MailMerge on Word With Access (Office 365) RRS feed

  • Question

  • The Word function VBA merge data with Access doesn´t work with Office 365, but works with Offices 97, 200, 2003, 2007, 2010, 2013, 2016 e 2019. The function is follow: ActiveDocument.MailMerge.OpenDataSource("",0,0,0,0,0,"","",0,"","","DSN=MS Access Database;DBQ=C:\Test\Test.Mdb","Select * From Test"). How can I do?
    Monday, December 9, 2019 3:22 PM

All replies

  • Hi Cláudio Araujo,

    Considering that your question is mainly related to automating Word with Visual Basic to create a Mail Merge to send Access data to Word, to help you better solve the problem, I will move the thread to Word for Developers Forum.

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Thanks for your kind understanding.

    Best Regards,

    Herb


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Office 2019.

    Tuesday, December 10, 2019 2:34 AM
  • Your code has an empty first argument (Name), which is the only required parameter. Try:

    ActiveDocument.MailMerge.OpenDataSource("C:\Test\Test.Mdb", 0, False, True, False, False, , , _
    False, , , "DSN=MS Access Database;DBQ=C:\Test\Test.Mdb", "Select * From Test", False, 1)




    Cheers
    Paul Edstein
    [MS MVP - Word]


    • Edited by macropodMVP Tuesday, December 10, 2019 4:20 AM
    Tuesday, December 10, 2019 4:19 AM
  • What is going wrong, exactly? 

    Your code relies on the fact that Windows has an ODBC DSN called "MS Access Database". As far as I know, recent versions of Office ensure that that DSN exists, at least on 64-bit versions of Windows with 32-bit versions of Office. But which versions of Windows and Office are you using, and what do you see when you look at the 32- and 64- bit ODBC administration functions?


    Peter Jamieson

    Tuesday, December 10, 2019 10:33 PM