ANYONE??????
I am using the redemption code to bypass the Outlook security. The main issue I am having is resolving email names individually (as I have at least 2 people in the TO and CC lines). However, I am having problems with resolving names in the CC field before the email gets sent out.
It appears that all the addresses get added to the TO field and not the CC field, even though I have made many different attempts to differentiate the two.
I have tried code on many sites provided, but to no avail. The "ccRecip.Type = olCC" does not seem to be doing anything for me.
Please help! Once I know how to get these into the CC field I will continue on working on resolving multiple names in the CC field, one by one, before sending it out.
I am using the redemption code to bypass the Outlook security. The main issue I am having is resolving email names individually (as I have at least 2 people in the TO and CC lines). However, I am having problems with resolving names in the CC field before the email gets sent out.
It appears that all the addresses get added to the TO field and not the CC field, even though I have made many different attempts to differentiate the two.
I have tried code on many sites provided, but to no avail. The "ccRecip.Type = olCC" does not seem to be doing anything for me.
Please help! Once I know how to get these into the CC field I will continue on working on resolving multiple names in the CC field, one by one, before sending it out.
Code:
[/font]
Dim i, j As Long
Dim strTO, strCC As String
Set OL_app = CreateObject("Outlook.Application")
Set OL_item = OL_app.CreateItem(0) 'Create a new message
Set namespace = OL_app.GetNamespace("MAPI")
namespace.Logon
'Create an instance of Redemption.safeMailItem
Set SafeItem = CreateObject("Redemption.safeMailItem")
SafeItem.Item = OL_item 'set Item property
strTO = Worksheets("Sheet1").Range("A1").Value
strCC = Worksheets("Sheet1").Range("A2").Value
'assume A1 value is "[email protected] [email="[email protected]"][email protected][/email]"
'A2 value is "[email protected] [email="[email protected]"][email protected][/email] [email="[email protected]"][email protected][/email]"
toList = Split(strTO, " ")
ccList = Split(strCC, " ")
' add TO list to email
For i = LBound(toList) To UBound(toList)
If StrComp(toList(i), "", vbTextCompare) <> 0 Then
Set SafeRecip = SafeItem.Recipients.Add(toList(i))
End If
Next i
' add CC list to email
For j = LBound(ccList) To UBound(ccList)
If StrComp(ccList(j), "", vbTextCompare) <> 0 Then
Set ccRecip = SafeItem.Recipients.Add(ccList(j))
ccRecip.Type = olCC
End If
Next j
' resolve distribution
SafeItem.Recipients.ResolveAll
' add subject header to email
SafeItem.Subject = "test"
' add body message to email
SafeItem.Body = "body"
SafeItem.Display
[font=Arial]
Last edited: