Copy Appointment Item

B

Ben Crinion

Hi

I have a custom appointment form(SMSAppointment) which has a extra tab on
it. Customers are complaining because when they send a meeting request to
someone the new appointment form is installed on the recipients machine as
the default appointment form.

Dimtry suggested setting the field to nothing but the code (see below) he
sent doesnt work and i dont understand it to juggle it so that it does.

I thought that i could catch the send event of the SMSAppointment, create a
new standard Appointmnt item and populate that with the details from the
SMSAppointment then send the standard Appointment and discard it saving the
SMSAppointment. The thing is i cant work out how to access the propertys of
either the safe item of the original item. Any suggestions? The code below
doesnt work

Thanks
Ben




My Code

Private Sub objAppointment_Send(Cancel As Boolean)
Debug.Print "Send"
'Cancel = True
'objAppointment_Write (Cancel)
On Error GoTo err_temp_appoint
'Create a new Appointment Item to send
Dim SafeItem As Redemption.SafeAppointmentItem
Set SafeItem = CreateObject("TBOLcom.SafeAppointmentItem")

'set the safeitem's item to a new olAppointmentItem
SafeItem.Item = oOL.CreateItem(olAppointmentItem)
Set SafeItem.OptionalAttendees = objAppointment.OptionalAttendees
Set SafeItem.RequiredAttendees = objAppointment.RequiredAttendees
Set SafeItem.Recipients = objAppointment.Recipients
Set SafeItem.Body = objAppointment.Body
Set SafeItem.Organizer = objAppointment.Organizer
Set SafeItem.Resources = objAppointment.Resources
Set SafeItem.NetMeetingOrganizerAlias =
objAppointment.NetMeetingOrganizerAlias

SafeItem.Send

' TODO: cancel send and save objAppointment

Set SafeItem = Nothing
Exit Sub
err_temp_appoint:
Debug.Print Err.Description
Resume Next
End Sub

Dimtry's Code
Dim sItem As Redemption.SafeAppointmentItem
Set sItem = CreateObject("TBOLcom.SafeAppointmentItem")

sItem.Item = objAppointment
Dim pr_form_storage

pr_form_storage =
sItem.GetIDsFromNames("{00062008-0000-0000-C000-000000000046}", &H850F) 'or
&H0102 'PT_BINARY
'pr_form_storage =
sItem.GetIDsFromNames("{00063033-0000-0000-C000-000000000046}", &H102)
'{00063033-0000-0000-C000-000000000046}
sItem.Fields(pr_form_storage) = Nothing
'sItem.Fields(pr_form_storage) = Nothing
 
B

Ben Crinion

Ok the code was very naive and I have revised the code so that it will set
many of the properties but now I realise that there are so many problems
with trying to copy the appointment item. Is there a definitive list of all
the properties that I would have to set in the new SafeAppointmentItem so
that it would duplicate the original item?
Or how can i set the tab to nothing in the SMSAppointment. i have looked and
looked at the form using outlook spy but im totally lost. going in circles
with different objects and never getting close to the property i need to
remove.

Ben
 

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