Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have several checkboxes with names of some of my
collegeaus on a Userform (chkPeter, chkMartin, etc). I want to used the emailadres that is associated to those checkboxes. I used the .ControlTip property of the checkbox to store the emailadres I need. Now I want to send an email to a collegeau if his checkbox is checked (chkPeter = True). From www.rondebruin.nl I already got: Private Sub Mail_Workbook_Outlook() 'This example send the last saved version of the Activeworkbook 'You must add a reference to the Microsoft outlook Library Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail 'Here I need code to get usernames depending on the checkboxes that are checked: .To = " For j = 1 To CheckBoxes.Count '??HOW do I count number of checked checkboxes?? .Recipients.Add = chk(i).ControlTipText Next .CC = "" .BCC = "" .Subject = "This is the Subject line - Mail Workbook" .Body = "Hi there" '.Attachments.Add ActiveWorkbook.FullName .Attachments.Add ActiveWorkbook.Path & "\" & ActiveWorkbook.Name 'You can add other files also like this '.Attachments.Add ("C:\test.txt") .Display '.Send 'or use End With Set OutMail = Nothing Set OutApp = Nothing End Sub How can I use a loop to : 1. check the name of the checked checkboxes; 2. read the emailaddress? Thanks in advance! Martin |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how can I count checkboxes that have been checked? | Excel Discussion (Misc queries) | |||
Mail Merge Without Recipients - Is It Something Else? | Excel Discussion (Misc queries) | |||
Mail Recipients | Setting up and Configuration of Excel | |||
how do you count checkboxes in excel2003 | Excel Worksheet Functions | |||
code Help - Routing Recipients | Excel Programming |