[Redemption/OOM] Adding SafeRecipient(s) Into a SafeAppointmentItem

M

Michael Zino

Dear All,

I am trying to add a safe recipient to a safe appointment item using redemption, but no recipients are added to the appointment item.
I am using the following code (from VB.NET, but it doesn't work from VB6 either):

Dim oSafeAppointmentItem As Redemption.SafeAppointmentItem
Dim oSafeRecipient As Redemption.SafeRecipient

oAppointmentItem.MeetingStatus = OlMeetingStatus.olMeeting
oSafeAppointmentItem = CreateObject("Redemption.SafeAppointmentItem")
oSafeAppointmentItem.Item = oAppointmentItem
oSafeAppointmentItem.AuthKey = "My@Key"

oSafeRecipient = oSafeItem.Recipients.Add("My Recipient")
oSafeRecipient.Resolve(True)

By looking inside oSafeRecipient instance, it seems that the recipient was resolved successfully as the EntryID was set with a valid value.
However, no recipient was added to the appointment itself. The appointment UI has no recipients after executing this code.

There are additional properties such as RequiredAtendeed, Resources, and OptionalAtendeeds, but they are read only and therefore cannot be accessed.

Thanks,
Michael Zino
 
K

Ken Slovak - [MVP - Outlook]

Did you check for oSafeRecipient.Resolved = True?




Dear All,

I am trying to add a safe recipient to a safe appointment item using
redemption, but no recipients are added to the appointment item.
I am using the following code (from VB.NET, but it doesn't work from VB6
either):

Dim oSafeAppointmentItem As Redemption.SafeAppointmentItem
Dim oSafeRecipient As Redemption.SafeRecipient

oAppointmentItem.MeetingStatus = OlMeetingStatus.olMeeting
oSafeAppointmentItem = CreateObject("Redemption.SafeAppointmentItem")
oSafeAppointmentItem.Item = oAppointmentItem
oSafeAppointmentItem.AuthKey = "My@Key"

oSafeRecipient = oSafeItem.Recipients.Add("My Recipient")
oSafeRecipient.Resolve(True)

By looking inside oSafeRecipient instance, it seems that the recipient was
resolved successfully as the EntryID was set with a valid value.
However, no recipient was added to the appointment itself. The appointment
UI has no recipients after executing this code.

There are additional properties such as RequiredAtendeed, Resources, and
OptionalAtendeeds, but they are read only and therefore cannot be accessed.

Thanks,
Michael Zino
 
M

Michael Zino

Hello Again,

The oSafeRecipients.Resolved is True, and the oSafeRecipients.Count is updated correctly.
Using the same code on a non-visible appointment item, actually adds the recipient.

It seems that the Outlook UI is unable to display changes made under the hood using Redemption (or CDO).
Therefore, I tend to believe that the problem is related to Outlook and to the Redemption.

For the meantime, I solved the problem with a very ugly workaround that seems to work just fine.

Dim oSafeAppointmentItem As Redemption.SafeAppointmentItem
Dim oSafeRecipient As Redemption.SafeRecipient
Dim oClonedAppointment As Outlook.AppointmentItem
Dim oInspector As Outlook.Inspector

Me._oAppointmentItem.MeetingStatus = OlMeetingStatus.olMeeting
oClonedAppointmentItem = Me._oAppointmentItem.Copy()
'Note: Copy() results oAppointmentItem to be saved.Therefore, it must be deleted later on

oSafeAppointmentItem = CreateObject("Redemption.SafeAppointmentItem")
oSafeAppointmentItem.Item = oClonedAppointmentItem
oSafeAppointmentItem.AuthKey = "My@Key"

oSafeRecipient = oSafeItem.Recipients.Add("My Recipient")
oSafeRecipient.Type = OlMeetingRecipientType.olResource
oSafeRecipient.Resolve(True)

Me._oAppointmentItem.Close(OlInspectorClose.olDiscard) 'Terminate the current open appointment UI
Me._oAppointmentItem.Delete()

Me._oAppointmentItem = oClonedAppointmentItem

oInspector = oClonedAppointmentItem.GetInspector() 'Display the new appointment item
If Not oInspector Is Nothing Then
oInspector.Display()
End If

I hope that there is a better way. Although, I hardly believe that this is the case.

Regards,
Michael Zino

Did you check for oSafeRecipient.Resolved = True?

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


Dear All,

I am trying to add a safe recipient to a safe appointment item using
redemption, but no recipients are added to the appointment item.
I am using the following code (from VB.NET, but it doesn't work from VB6
either):

Dim oSafeAppointmentItem As Redemption.SafeAppointmentItem
Dim oSafeRecipient As Redemption.SafeRecipient

oAppointmentItem.MeetingStatus = OlMeetingStatus.olMeeting
oSafeAppointmentItem = CreateObject("Redemption.SafeAppointmentItem")
oSafeAppointmentItem.Item = oAppointmentItem
oSafeAppointmentItem.AuthKey = "My@Key"

oSafeRecipient = oSafeItem.Recipients.Add("My Recipient")
oSafeRecipient.Resolve(True)

By looking inside oSafeRecipient instance, it seems that the recipient was
resolved successfully as the EntryID was set with a valid value.
However, no recipient was added to the appointment itself. The appointment
UI has no recipients after executing this code.

There are additional properties such as RequiredAtendeed, Resources, and
OptionalAtendeeds, but they are read only and therefore cannot be accessed.

Thanks,
Michael Zino
 
D

Dmitry Streblechenko \(MVP\)

Outlook does not see changes made using Extended MAPI until you completely
dereference the object and reopen it.
Since only reading RequiredAtendeed, Resources, and OptionalAtendeeds is
blocked by OOM, you can set these properties on the original OOM appointment
without triggering the prompt.

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

Dear All,

I am trying to add a safe recipient to a safe appointment item using
redemption, but no recipients are added to the appointment item.
I am using the following code (from VB.NET, but it doesn't work from VB6
either):

Dim oSafeAppointmentItem As Redemption.SafeAppointmentItem
Dim oSafeRecipient As Redemption.SafeRecipient

oAppointmentItem.MeetingStatus = OlMeetingStatus.olMeeting
oSafeAppointmentItem = CreateObject("Redemption.SafeAppointmentItem")
oSafeAppointmentItem.Item = oAppointmentItem
oSafeAppointmentItem.AuthKey = "My@Key"

oSafeRecipient = oSafeItem.Recipients.Add("My Recipient")
oSafeRecipient.Resolve(True)

By looking inside oSafeRecipient instance, it seems that the recipient was
resolved successfully as the EntryID was set with a valid value.
However, no recipient was added to the appointment itself. The appointment
UI has no recipients after executing this code.

There are additional properties such as RequiredAtendeed, Resources, and
OptionalAtendeeds, but they are read only and therefore cannot be accessed.

Thanks,
Michael Zino
 
M

Michael Zino

Dear Dmitry,

When I am accessing these properties on the original OOM's appointment item,
I am getting the security prompts.

Regards,
Michael Zino
 
D

Dmitry Streblechenko \(MVP\)

Yes, when you are reading them (you can bypass the prompts using
Redemption), but setting these properties is not blocked, so they can be set
using Outlook Object Model, e.g.
oAppointmentItem.RequiredAttendees = "(e-mail address removed)"

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top