Zane Stein
08-30-2012, 07:49 PM
I'm very new to VBA, so forgive my ignorance. I'm working with Word 2010.
I've created a form the user must fill out. What I'm trying to do, once the user has finished answering the other questions on the form, to have them click on the individuals who need to get a copy of the form and have it emailed to all selected. I assumed this would entail:
1 Create a listbox with 6 names in it
2 Enable the user to click on one or more names to highlight the names they want
3 Make sure if they click a name a second time it takes the highlight off that name
4 Set it so that when they click on the module beginning CommandButton2_Click() it will send a copy of the ActiveDocument to the email address of each person in the listbox whose name has been highlighted
I am not really sure how to populate the listbox properly with the individual entries.
I've created a button successfully that will send the document to predesignated email addresses that are hard programmed into the vba script.
What I can't figure out is the proper coding to list the individuals in the listbox, and then set up a if/then statement so that when the button is clicked, it will send the document only to the selected people in the listbox.
Can anyone assist?
Thank you.
Zane
I've created a form the user must fill out. What I'm trying to do, once the user has finished answering the other questions on the form, to have them click on the individuals who need to get a copy of the form and have it emailed to all selected. I assumed this would entail:
1 Create a listbox with 6 names in it
2 Enable the user to click on one or more names to highlight the names they want
3 Make sure if they click a name a second time it takes the highlight off that name
4 Set it so that when they click on the module beginning CommandButton2_Click() it will send a copy of the ActiveDocument to the email address of each person in the listbox whose name has been highlighted
I am not really sure how to populate the listbox properly with the individual entries.
I've created a button successfully that will send the document to predesignated email addresses that are hard programmed into the vba script.
What I can't figure out is the proper coding to list the individuals in the listbox, and then set up a if/then statement so that when the button is clicked, it will send the document only to the selected people in the listbox.
Can anyone assist?
Thank you.
Zane