Email send not working with To and CC

drmingle

Board Regular
Joined
Oct 5, 2009
Messages
229
This code works beautifully when there is email addresses in the CC field, but when there is no value in the CC field than an error code 2295 pops up stating unknown message recipient.

I need help with what I think should be a conditional snippet: if Me.CC = " ", then Me.From only else Me.From and Me.CC.

Code:
Private Sub EmailOriginator_Click()
DoCmd.SendObject _
    , _
    , _
    , _
    """" & Me.From & """", _
    """" & Me.CC & """", _
    , _
    "COMPLETED: " & Me.ID & " " & Me.Subject, _
    "SOS Comments: " & Me.CommentSOS & vbNewLine & vbNewLine & "APSIA Comments: " & Me.CommentAPSIA & vbNewLine & vbNewLine & "Original Message: " & Me.Message & vbNewLine, _
    True

Me.Status = "Closed"

End Sub

Any help would be appreciated...
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top