Click here to Skip to main content
15,885,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all

I have a datagrid where I am showing contact list of our people with their individual email address/s. I have added a checkbox.
I want to check if outlook new message is open if it is open then add all selected email address (datagrid cell value) to the BCC field.

Here is my code
VB
Private Sub AddBCC()

    Dim emailList As New List(Of String)
    Dim OutlookMessage As Outlook.MailItem
    Dim AppOutlook As New Outlook.Application
    OutlookMessage = AppOutlook.CreateItem(Outlook.OlItemType.olMailItem)

    For Each row As DataGridViewRow In dgLoad.Rows

        If row.Cells(0).Value = True Then
            emailList.Add(row.Cells(6).Value)
        End If
    Next
    OutlookMessage.Subject = "Testing all bcc e-mail"
    OutlookMessage.Display(True)
    OutlookMessage = Nothing
    AppOutlook = Nothing
End Sub



This code cant check if outlook new message window is open or not?
Emails doesnt to go bcc field of new message.
Can you please guide me with this?
thanks
Posted
Updated 13-Feb-14 17:22pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900