Results 1 to 7 of 7
  1. #1
    aschrades is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    3

    Access 2010 DB, Word 2013 Mail Merge not working. Works with Word 2010.


    Hello! I inherited an Access database that overall works well with Office 2010. We recently setup some new PC's that have Office 2013 but we kept Access on version 2010. There is a section of the database that does a mail merge with word to print some documents. This works great on a Word 2010\Access 2010 PC but on the Access 2010\Word 2013 the form locks up for about 15 seconds then nothing happens. Word never opens, no error message, etc. This happens on every PC with the Access 2010\Word 2013 combo.

    My first thought was trust center settings so I have Access and Word set to be as trustworthy as I can get them. The DB folder is trusted, enable macros, active-x, etc.

    Here is the snippet of code that I believe is causing the problem. Any ideas for me?

    Thanks!

    Code:
      
    If Forms![LeaseDocPrint]![chkLease].Value = True Then    
        
        Set objWord = GetObject("Z:\path_to_file\Residential Lease.doc", "Word.Document")
        
        objWord.Application.DisplayAlerts = wdAlertsNone
         
        objWord.MailMerge.Destination = wdSendToNewDocument
        objWord.MailMerge.Execute
        
        objWord.Application.Options.PrintBackground = False
        objWord.Application.ActiveDocument.PrintOut
        
        objWord.Application.ActiveDocument.Close False
        objWord.Application.Documents(1).Close False
      End If

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Issue may be that Access 2010 would not have the VBA reference library for Word 2013, assuming it is different from Word 2010.

    You don't show the code that declares objWord. Is it explicitly declaring it as a Word object? Use of late binding might correct the issue. However, that means intellisense popup tips won't work.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by aschrades View Post
    ...My first thought was trust center settings...
    That was my first thought but then I started to think about Access 2010 trying to interact with Word. Access will likely be looking for Word in the 14 folder where there is not a Word App. Access has no way of knowing Word is in 15.

    Like June suggested, late binding may be your best hope.
    dim objWord as object

    However, this seems problematic
    ("Z:\path_to_file\Residential Lease.doc", "Word.Document")

    Perhaps late binding and
    ("Z:\path_to_file\Residential Lease.doc")

  4. #4
    aschrades is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    3
    Code:
     Dim objWord As Word.Document
        
      If Forms![LeaseDocPrint]![chkLease].Value = True Then
        Set objWord = GetObject("Z:\Feldman\LeaseDocuments\Residential Lease.doc", "Word.Document")
        'Set objWord = GetObject("C:\Work\FREI\LeaseDocuments\Residential Lease.doc", "Word.Document")
        objWord.Application.DisplayAlerts = wdAlertsNone
         
        objWord.MailMerge.Destination = wdSendToNewDocument
        objWord.MailMerge.Execute
        
        objWord.Application.Options.PrintBackground = False
        objWord.Application.ActiveDocument.PrintOut
        
        objWord.Application.ActiveDocument.Close False
        objWord.Application.Documents(1).Close False
      End If
    Sorry, here is the code with the dim for objword. I'll look up what late binding is. I'm a little worry to change something and break the Word 2010 functionality.

    -Adam

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    ItsMe shows example of late binding in post 3
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    aschrades is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    3
    No luck. I changed the Dim statement to what itsme said and tried it, then tried it with taking the word.document off the end. It still just freezes for 15 seconds. No error.

    It might be that it can't find Word 2013, but I'm not sure how to point it in the right direction.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Just maybe Access 2010 cannot manipulate Word 2013. Maybe Access 2013 could manipulate Word 2010. But who would have Access 2013 and not Word 2013?

    Might just have to move up to Access 2013.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-14-2014, 04:34 AM
  2. Mail merge from from Access to Word
    By williamgladstone in forum Access
    Replies: 1
    Last Post: 03-22-2011, 12:00 PM
  3. Access Query mail merge to Word
    By Jan Collier in forum Access
    Replies: 8
    Last Post: 08-30-2010, 09:52 AM
  4. Access / Word mail merge problem.
    By PD1117 in forum Access
    Replies: 0
    Last Post: 07-06-2010, 09:41 AM
  5. Mail Merge from Access to Word
    By Rachelkm2 in forum Programming
    Replies: 1
    Last Post: 05-29-2009, 02:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums