Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2012
    Posts
    8

    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
    Join Date
    Mar 2009
    Posts
    5,249
    As explained in Access help, you can enumerate (retrieve) each selected item (value) from a ListBox control with its MultiSelect property set to 1 (Simple) or 2 (Extended), like this:
    Code:
        Dim frm As Form
        Dim ctl As Control
        Dim varItem As Variant
    
        Set frm = Forms!FormName  ' Replace FormName with the actual name of the Form.
        Set ctl = frm!ListName    ' Replace ListName with the actual name of the ListBox control.
        For Each varItem In ctl.ItemsSelected
            Debug.Print ctl.ItemData(varItem)    ' ctl.ItemData(varItem) contains a value among those selected in the list.
        Next varItem
    Have a nice day!

  3. #3
    Join Date
    Nov 2012
    Posts
    8

    Question

    Thank you for your reply! I will try to merge this into the current code.

    ...
    On further review of the actual set up of the form itself, the box that lists the documents to be merged is acutally a unbound textbox. There is coding somewhere (haven't located yet) that loads the documents into the unbound textbox.
    Based on this info alone, will the code you provided (Thank you again) still apply because it is not a listbox?

    Here is a Link to mail merge program:
    Page Title
    Titled: Super Easy Mail Merge

  4. #4
    Join Date
    Mar 2009
    Posts
    5,249
    Quote Originally Posted by David92595 View Post
    Based on this info alone, will the code you provided (Thank you again) still apply because it is not a listbox?
    I don't think so. ItemsSelected and ItemData are specific to a ListBox control (as far as I know there is no other standard control in Access that allows to select several values simultaneously).

    However, nothing prevents you from replacing the TextBox control by a ListBox control (with some additional coding).
    Have a nice day!

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
  •