Results 1 to 4 of 4
  1. #1
    David92595 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2012
    Posts
    22

    Question Mail Merge Multiple Documents At Once, Albert Kallal

    Hello,



    I am currently using Albert Kallal's (Awesome) mail merge.

    I am looking for a way to select multiple documents from the word Merge Templates list and merge them all at once. Mail merge is a significant portion of what my company does and finding a way to merge all of our documents at once would be HUGE!

    I have been told that I need to allow multi-select in the selection listbox. But the coding is a bit over my head...

    If you know what segment of code needs to be altered (something I can search for), or a forum that has this solution I would be very gratful. I have been looking for a while now and not had any luck.

    Thank you,

    David92595

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I think what you want is code that will cycle through the items of the listbox and perform action with each selected item. This is a loop. Something like:
    Code:
        With Me.lstCategory
            For Each varItem In .ItemsSelected
                If Not IsNull(varItem) Then
                    'your code to do something
                End If
            Next
        End With
    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
    David92595 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2012
    Posts
    22
    Here is the onclick command of Alberts code:

    Code:
    Private Sub cmdMerge_Click()
    Dim strExt As String
    
    strExt = IIf(Application.Version <= 11, ".doc", ".docx")
    
    ' merge the doc
    If IsNull(Me.lstFiles) = False Then
    
    ' for compat
    If Dir(strDirPath & Me.lstFiles & strExt) = "" Then
    If strExt = ".docx" Then
    strExt = ".doc"
    End If
    End If
    
    Call RidesMergeWord(strDirPath & Me.lstFiles & strExt, strDirPath, strOutDocName)
    strTemplate = Me.lstFiles
    DoCmd.Close acForm, Me.Name
    
    Else
    
    MsgBox "You need to select a Word document", vbExclamation, "Word Merge"
    strTemplate = ""
    
    End If
    End Sub
    Would I be inserting your code before " Call RidesMergeWord(strDirPath & Me.lstFiles & strExt, strDirPath, strOutDocName)" or set it = to "strTemplate" (in the line below)?
    ...or am I completely wrong...

    Thank you!
    David92595

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I've never used multi-select listbox but I guess you would want to test if at least one item is selected before running procedure. So place all your code following If IsNull(Me.lstFiles) = False Then and up to Else within the loop code I suggested.
    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: 7
    Last Post: 10-30-2012, 02:18 PM
  2. Access to Word Merge into Separately Saved Documents
    By alpinegroove in forum Programming
    Replies: 6
    Last Post: 01-05-2012, 04:49 PM
  3. Access to merge documents
    By SJames in forum Access
    Replies: 2
    Last Post: 04-25-2011, 09:27 AM
  4. Mail Merge
    By Nixx1401 in forum Access
    Replies: 1
    Last Post: 02-15-2010, 10:51 AM
  5. Mail merge
    By grgerhard in forum Forms
    Replies: 0
    Last Post: 04-25-2006, 05:06 PM

Tags for this Thread

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