2014-02-17 15 views
0

我在outook 2013试图从数据库错误:必须有至少一个名称或通讯组列表中,以CC或BCC箱

充满,如果我从DataGridView选择所有的行BCC领域开放新的邮件它抛出异常错误“错误:至cc或密件抄送框中必须至少有一个名称或通讯组列表”

对于在密件抄送字段中添加的电子邮件数量是否有任何限制? 这里是我的代码

Dim mail As Outlook.MailItem 

    Dim AppOutlook As New Outlook.Application 

    mail = AppOutlook.CreateItem(Outlook.OlItemType.olMailItem) 
    mail.Subject = "Sample Message" 
    mail.To = "[email protected]" 
    For Each row As DataGridViewRow In dgLoad.Rows 
     'If row.Cells(0).Value = True Then 
     If Me.dgLoad(0, 0).Value = Me.chkBox.Checked Then 

      'End If 
      Dim address As String = row.Cells(6).Value 
      Dim recipBcc As Outlook.Recipient = mail.Recipients.Add(address) 
      recipBcc.Type = CInt(Outlook.OlMailRecipientType.olBCC) 
     End If 
    Next 

    mail.Display(True) 

请帮我...

回答

1

你可能获得该消息时row.Cells(6).Value是一个空字符串。尝试添加if语句以跳过接下来的三条语句(如果是这种情况)。

相关问题