How to set CC @ Outlook Redemption

L

Luk

can anyone post me a sample code, how to use the Outlook Redemption CC
& BCC ?
when i try .cc ="[email protected]" or .bcc = "[email protected]" then i get an error
"read only"


The Code is:

Imports Microsoft.Office.Interop.Outlook
Imports Redemption

Class Form1
Dim outApp As Microsoft.Office.Interop.Outlook.Application
Dim outMail As Microsoft.Office.Interop.Outlook.MailItem
Dim safMail As SafeMailItem

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

outApp = New Microsoft.Office.Interop.Outlook.Application
outMail = outApp.CreateItem(OlItemType.olMailItem)
safMail = New SafeMailItem
safMail.Item = outMail

With safMail
..Recipients.Add("[email protected]")
..Cc = "[email protected]" <- JUST READONLY ???
..Bcc = "[email protected]" <- JUST READONLY ???
..Subject = "subject"
..Body = "something"
..Send()
End safMail

End Sub
End Class

can anyone help me?

tanks in advance!
 
K

Ken Slovak - [MVP - Outlook]

Dim safRecip As Redemption.SafeRecipient

With safMail
safRecip = .Recipients.Add("[email protected]")
safRecip.Type = olBCC 'or olCC, as desired
safRecip.Resolve
 
D

Dmitry Streblechenko

Only reading of the To/CC/BCC properties is blocked, but not writing, hence
SafeMailItem object only implements the read access of these properties. If
you use late binding to avoid the compiler errors, SafeMailItem will
trasparently forward the calls to the property setters to the original OOM
object assigned to the Item property. Or you can set these properties
directly on the outMail object.
Or you can use the SafeMailItem.Recipients collection to add each recipient
by calling Recipients.Add

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
L

Luk

Hello Ken,

safRecip.Type = olBCC <----- "the name "olBCC" is not declared" ...
what is wrong?

Dim safRecip As Redemption.SafeRecipient

With safMail
safRecip = .Recipients.Add("[email protected]")
safRecip.Type = olBCC 'or olCC, as desired
safRecip.Resolve

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm

Luk said:
can anyone post me a sample code, how to use the Outlook Redemption CC
& BCC ?
when i try .cc ="[email protected]" or .bcc = "[email protected]" then i get an error
"read only"
The Code is:
Imports Microsoft.Office.Interop.Outlook
Imports Redemption
Class Form1
Dim outApp As Microsoft.Office.Interop.Outlook.Application
Dim outMail As Microsoft.Office.Interop.Outlook.MailItem
Dim safMail As SafeMailItem
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
outApp = New Microsoft.Office.Interop.Outlook.Application
outMail = outApp.CreateItem(OlItemType.olMailItem)
safMail = New SafeMailItem
safMail.Item = outMail
With safMail
.Recipients.Add("[email protected]")
.Cc = "[email protected]" <- JUST READONLY ???
.Bcc = "[email protected]" <- JUST READONLY ???
.Subject = "subject"
.Body = "something"
.Send()
End safMail
End Sub
End Class
can anyone help me?
tanks in advance!
 
L

Luk

Hello Dmitry, hello Ken,

safRecip.Type = olBCC <----- "the name "olBCC" is not declared" ...
what is wrong?
 
K

Ken Slovak - [MVP - Outlook]

Outlook.OlMailRecipientType.olBCC

The Object Browser can be used to see what enumerations are there and what
properties, methods and events any object might have. Searching on olBCC in
the Object Browser returns the correct enumeration and enumeration member.
 
L

Luk

thank you very much Ken!!!



Outlook.OlMailRecipientType.olBCC

The Object Browser can be used to see what enumerations are there and what
properties, methods and events any object might have. Searching on olBCC in
the Object Browser returns the correct enumeration and enumeration member.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm

Luk said:
Hello Ken,
safRecip.Type = olBCC <----- "the name "olBCC" is not declared" ...
what is wrong?
 
Top