If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Mail Merge Multiple Documents At Once, Albert Kallal

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
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
Reply With Quote
  #2 (permalink)  
Old
Moderator
 
Join Date: Mar 2009
Posts: 5,194
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!
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old
Moderator
 
Join Date: Mar 2009
Posts: 5,194
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!
Reply With Quote
Reply

Tags
albert kallal, mail merge

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On