Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: 26 Apr 2006 03:29:54 -0700,    group: microsoft.public.exchange2000.development        back       


Removing appointment from calendar   
Hello,

I have problems removing appointments from a calendar if the number of
attendees is 0. The following code works as expected (cancel messages
are sent to attendees and original appointment is deleted from meeting
organizer calendar):

Dim urlCalendar As String = _
  "http://MyExchangeServer/exchange/MailboxName/Calendar"
Dim adoCnx As New ADODB.Connection
adoCnx.Provider = "MSDAIPP.DSO"
adoCnx.Open(urlCalendar)
Dim oAppt As New CDO.Appointment
oAppt.DataSource.Open(AppointmentUID, adoCnx, _
  ADODB.ConnectModeEnum.adModeReadWrite, _
  ADODB.RecordCreateOptionsEnum.adFailIfNotExists, _
  ADODB.RecordOpenOptionsEnum.adOpenSource)
Dim cfg As CDO.Configuration = New CDO.Configuration
With cfg
..Fields(CDO.CdoConfiguration.cdoSendEmailAddress).Value = _
  "myaddress@mydomain.com"
..Fields(CDO.CdoCalendar.cdoTimeZoneIDURN).Value = _
  CDO.CdoTimeZoneId.cdoIsrael
..Fields(CDO.CdoConfiguration.cdoSendUsingMethod).Value = _
  CDO.CdoSendUsing.cdoSendUsingPort
..Fields(CDO.CdoConfiguration.cdoSMTPServer).Value = _
  MySMTPServer
..Fields.Update()
End With
oAppt.Configuration = cfg
oAppt.Cancel.Message.Send()       ' Fails if Attendees.count = 0!!!!
cfg = Nothing

If the appointment number of attendees is 0, the code fails with an
exception "System.Runtime.InteropServices.COMException - Multiple-step
OLE DB operation generated errors. Check each OLE DB status value, if
available. No work was done." Trying only oAppt.Cancel throws an
exception "The requested property was not found".

TIA
date: 26 Apr 2006 03:29:54 -0700   author:   unknown

Re: Removing appointment from calendar   
Problem solved. This works for me:

      Dim recDelMsg As New ADODB.Record
      recDelMsg.Open(oAppt.Fields("DAV:href").Value, adoCnx, _
                     ADODB.ConnectModeEnum.adModeReadWrite, _
                     ADODB.RecordCreateOptionsEnum.adFailIfNotExists, _
                     ADODB.RecordOpenOptionsEnum.adOpenSource)
      recDelMsg.DeleteRecord()
      recDelMsg.Close()
      recDelMsg = Nothing



yoav.benyosef@gmail.com wrote:
> Hello,
>
> I have problems removing appointments from a calendar if the number of
> attendees is 0. The following code works as expected (cancel messages
> are sent to attendees and original appointment is deleted from meeting
> organizer calendar):
>
> Dim urlCalendar As String = _
>   "http://MyExchangeServer/exchange/MailboxName/Calendar"
> Dim adoCnx As New ADODB.Connection
> adoCnx.Provider = "MSDAIPP.DSO"
> adoCnx.Open(urlCalendar)
> Dim oAppt As New CDO.Appointment
> oAppt.DataSource.Open(AppointmentUID, adoCnx, _
>   ADODB.ConnectModeEnum.adModeReadWrite, _
>   ADODB.RecordCreateOptionsEnum.adFailIfNotExists, _
>   ADODB.RecordOpenOptionsEnum.adOpenSource)
> Dim cfg As CDO.Configuration = New CDO.Configuration
> With cfg
> .Fields(CDO.CdoConfiguration.cdoSendEmailAddress).Value = _
>   "myaddress@mydomain.com"
> .Fields(CDO.CdoCalendar.cdoTimeZoneIDURN).Value = _
>   CDO.CdoTimeZoneId.cdoIsrael
> .Fields(CDO.CdoConfiguration.cdoSendUsingMethod).Value = _
>   CDO.CdoSendUsing.cdoSendUsingPort
> .Fields(CDO.CdoConfiguration.cdoSMTPServer).Value = _
>   MySMTPServer
> .Fields.Update()
> End With
> oAppt.Configuration = cfg
> oAppt.Cancel.Message.Send()       ' Fails if Attendees.count = 0!!!!
> cfg = Nothing
>
> If the appointment number of attendees is 0, the code fails with an
> exception "System.Runtime.InteropServices.COMException - Multiple-step
> OLE DB operation generated errors. Check each OLE DB status value, if
> available. No work was done." Trying only oAppt.Cancel throws an
> exception "The requested property was not found".
> 
> TIA
date: 26 Apr 2006 05:18:21 -0700   author:   unknown

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us