PC Review


Reply
Thread Tools Rate Thread

Delete an All Day Appointment using VBA

 
 
=?Utf-8?B?QW5keQ==?=
Guest
Posts: n/a
 
      9th Jan 2005
I have successfully added an All Day appointment for tomorrow in Outlook from
Access using :-

--------------

Dim objOutlook As Outlook.Application
Dim objCalendar As Object
Dim objAppointment As Object

Set objOutlook = New Outlook.Application
Set objCalendar = objOutlook.Session.GetDefaultFolder(olFolderCalendar)

Set objAppointment = objCalendar.Items.Add
With objAppointment
.Subject = "Test"
.Start = Date + 1
.AllDayEvent = True
End With
objAppointment.Close olSave
Set objAppointment = Nothing
Set objOutlook = Nothing

---------

Can anyone help me with the code to delete the same appointment using VBA?

Thanks.



 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      9th Jan 2005
Delete it in what context? If you get the item's EntryID after saving it and
store that in your Access database, you can return the same item with the
Namespace.GetItemFromID and then delete it with the AppointmentItem.Delete
method.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Andy" <(E-Mail Removed)> wrote in message
newsB7F9858-6C2B-4E9B-A3EF-(E-Mail Removed)...
>I have successfully added an All Day appointment for tomorrow in Outlook
>from
> Access using :-
>
> --------------
>
> Dim objOutlook As Outlook.Application
> Dim objCalendar As Object
> Dim objAppointment As Object
>
> Set objOutlook = New Outlook.Application
> Set objCalendar = objOutlook.Session.GetDefaultFolder(olFolderCalendar)
>
> Set objAppointment = objCalendar.Items.Add
> With objAppointment
> .Subject = "Test"
> .Start = Date + 1
> .AllDayEvent = True
> End With
> objAppointment.Close olSave
> Set objAppointment = Nothing
> Set objOutlook = Nothing
>
> ---------
>
> Can anyone help me with the code to delete the same appointment using VBA?
>
> Thanks.
>
>
>



 
Reply With Quote
 
=?Utf-8?B?QW5keQ==?=
Guest
Posts: n/a
 
      9th Jan 2005
Thanks Sue - good idea.

I'm OK with obtaining and storing the EntryID for later use but could you
help more with the syntax with Namespace.GetItemFromID and
AppointmentItem.Delete - I'm not so familar with these two contructs.

Regards - Andy.

"Sue Mosher [MVP-Outlook]" wrote:

> Delete it in what context? If you get the item's EntryID after saving it and
> store that in your Access database, you can return the same item with the
> Namespace.GetItemFromID and then delete it with the AppointmentItem.Delete
> method.
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "Andy" <(E-Mail Removed)> wrote in message
> newsB7F9858-6C2B-4E9B-A3EF-(E-Mail Removed)...
> >I have successfully added an All Day appointment for tomorrow in Outlook
> >from
> > Access using :-
> >
> > --------------
> >
> > Dim objOutlook As Outlook.Application
> > Dim objCalendar As Object
> > Dim objAppointment As Object
> >
> > Set objOutlook = New Outlook.Application
> > Set objCalendar = objOutlook.Session.GetDefaultFolder(olFolderCalendar)
> >
> > Set objAppointment = objCalendar.Items.Add
> > With objAppointment
> > .Subject = "Test"
> > .Start = Date + 1
> > .AllDayEvent = True
> > End With
> > objAppointment.Close olSave
> > Set objAppointment = Nothing
> > Set objOutlook = Nothing
> >
> > ---------
> >
> > Can anyone help me with the code to delete the same appointment using VBA?
> >
> > Thanks.
> >
> >
> >

>
>
>

 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      9th Jan 2005
When in doubt, check the object browser: Press ALt+F11 to open the VBA
environment in Outlook, then press F2. Switch from <All Libraries> to
Outlook to browse all Outlook objects and their properties, methods, and
events. Select any object or member, then press F1 to see its Help topic.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Andy" <(E-Mail Removed)> wrote in message
news:56FDB3C3-9810-4877-A442-(E-Mail Removed)...
> Thanks Sue - good idea.
>
> I'm OK with obtaining and storing the EntryID for later use but could you
> help more with the syntax with Namespace.GetItemFromID and
> AppointmentItem.Delete - I'm not so familar with these two contructs.
>
> Regards - Andy.
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
>> Delete it in what context? If you get the item's EntryID after saving it
>> and
>> store that in your Access database, you can return the same item with the
>> Namespace.GetItemFromID and then delete it with the
>> AppointmentItem.Delete
>> method.
>>
>> --
>> Sue Mosher, Outlook MVP
>> Author of
>> Microsoft Outlook Programming - Jumpstart for
>> Administrators, Power Users, and Developers
>> http://www.outlookcode.com/jumpstart.aspx
>>
>>
>> "Andy" <(E-Mail Removed)> wrote in message
>> newsB7F9858-6C2B-4E9B-A3EF-(E-Mail Removed)...
>> >I have successfully added an All Day appointment for tomorrow in Outlook
>> >from
>> > Access using :-
>> >
>> > --------------
>> >
>> > Dim objOutlook As Outlook.Application
>> > Dim objCalendar As Object
>> > Dim objAppointment As Object
>> >
>> > Set objOutlook = New Outlook.Application
>> > Set objCalendar = objOutlook.Session.GetDefaultFolder(olFolderCalendar)
>> >
>> > Set objAppointment = objCalendar.Items.Add
>> > With objAppointment
>> > .Subject = "Test"
>> > .Start = Date + 1
>> > .AllDayEvent = True
>> > End With
>> > objAppointment.Close olSave
>> > Set objAppointment = Nothing
>> > Set objOutlook = Nothing
>> >
>> > ---------
>> >
>> > Can anyone help me with the code to delete the same appointment using
>> > VBA?
>> >
>> > Thanks.
>> >
>> >
>> >

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?QW5keQ==?=
Guest
Posts: n/a
 
      10th Jan 2005
Sue - Sorry to push a bit more on this subject but it is interesting.
Firstly, I took your advice and looked at the VBA help files to work out the
syntax of the various methods. I did struggle with Namespace though and found
that I had to use Session instead.

Anyway - I created 3 Appointment items one after the other and saved each
before obtaining their EntryID - suprisingly each EntryID was the same even
though the 3 appointments were on different days albeit with the same Subject
for each.

I stored these away but when I came to later use them to delete the
appointments, I got a failure when I tried to set a variable as follows :-

CalEntryIDR = objOutlook.Session.GetItemFromID(CalEntryID) ' CalEntryID is
the long EntryID value

Also when I actually got this statement to work (just after creating the
appointment) the returned value was the Subject of the appointment ???

Any ideas? Especially the difference between Namespace and Session and why
the 3 IDs were the same above.

Thanks.

The variable CalEntryID contains the long EntryID value.
"Sue Mosher [MVP-Outlook]" wrote:

> When in doubt, check the object browser: Press ALt+F11 to open the VBA
> environment in Outlook, then press F2. Switch from <All Libraries> to
> Outlook to browse all Outlook objects and their properties, methods, and
> events. Select any object or member, then press F1 to see its Help topic.
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "Andy" <(E-Mail Removed)> wrote in message
> news:56FDB3C3-9810-4877-A442-(E-Mail Removed)...
> > Thanks Sue - good idea.
> >
> > I'm OK with obtaining and storing the EntryID for later use but could you
> > help more with the syntax with Namespace.GetItemFromID and
> > AppointmentItem.Delete - I'm not so familar with these two contructs.
> >
> > Regards - Andy.
> >
> > "Sue Mosher [MVP-Outlook]" wrote:
> >
> >> Delete it in what context? If you get the item's EntryID after saving it
> >> and
> >> store that in your Access database, you can return the same item with the
> >> Namespace.GetItemFromID and then delete it with the
> >> AppointmentItem.Delete
> >> method.
> >>
> >> --
> >> Sue Mosher, Outlook MVP
> >> Author of
> >> Microsoft Outlook Programming - Jumpstart for
> >> Administrators, Power Users, and Developers
> >> http://www.outlookcode.com/jumpstart.aspx
> >>
> >>
> >> "Andy" <(E-Mail Removed)> wrote in message
> >> newsB7F9858-6C2B-4E9B-A3EF-(E-Mail Removed)...
> >> >I have successfully added an All Day appointment for tomorrow in Outlook
> >> >from
> >> > Access using :-
> >> >
> >> > --------------
> >> >
> >> > Dim objOutlook As Outlook.Application
> >> > Dim objCalendar As Object
> >> > Dim objAppointment As Object
> >> >
> >> > Set objOutlook = New Outlook.Application
> >> > Set objCalendar = objOutlook.Session.GetDefaultFolder(olFolderCalendar)
> >> >
> >> > Set objAppointment = objCalendar.Items.Add
> >> > With objAppointment
> >> > .Subject = "Test"
> >> > .Start = Date + 1
> >> > .AllDayEvent = True
> >> > End With
> >> > objAppointment.Close olSave
> >> > Set objAppointment = Nothing
> >> > Set objOutlook = Nothing
> >> >
> >> > ---------
> >> >
> >> > Can anyone help me with the code to delete the same appointment using
> >> > VBA?
> >> >
> >> > Thanks.
> >> >
> >> >
> >> >
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      10th Jan 2005
Show the code used to instantiate the Namespace and to save the items and
get their EntryIDs.

GetItemFromID returns an object. You need to use Set:

Set CalEntryIDR = objNS.GetItemFromID(CalEntryID)

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Andy" <(E-Mail Removed)> wrote in message
news:F52F1C45-D96D-416F-8B3F-(E-Mail Removed)...
> Sue - Sorry to push a bit more on this subject but it is interesting.
> Firstly, I took your advice and looked at the VBA help files to work out
> the
> syntax of the various methods. I did struggle with Namespace though and
> found
> that I had to use Session instead.
>
> Anyway - I created 3 Appointment items one after the other and saved each
> before obtaining their EntryID - suprisingly each EntryID was the same
> even
> though the 3 appointments were on different days albeit with the same
> Subject
> for each.
>
> I stored these away but when I came to later use them to delete the
> appointments, I got a failure when I tried to set a variable as follows :-
>
> CalEntryIDR = objOutlook.Session.GetItemFromID(CalEntryID) ' CalEntryID is
> the long EntryID value
>
> Also when I actually got this statement to work (just after creating the
> appointment) the returned value was the Subject of the appointment ???
>
> Any ideas? Especially the difference between Namespace and Session and why
> the 3 IDs were the same above.
>
> Thanks.
>
> The variable CalEntryID contains the long EntryID value.
> "Sue Mosher [MVP-Outlook]" wrote:
>
>> When in doubt, check the object browser: Press ALt+F11 to open the VBA
>> environment in Outlook, then press F2. Switch from <All Libraries> to
>> Outlook to browse all Outlook objects and their properties, methods, and
>> events. Select any object or member, then press F1 to see its Help topic.
>>
>> "Andy" <(E-Mail Removed)> wrote in message
>> news:56FDB3C3-9810-4877-A442-(E-Mail Removed)...
>> > Thanks Sue - good idea.
>> >
>> > I'm OK with obtaining and storing the EntryID for later use but could
>> > you
>> > help more with the syntax with Namespace.GetItemFromID and
>> > AppointmentItem.Delete - I'm not so familar with these two contructs.
>> >
>> > Regards - Andy.
>> >
>> > "Sue Mosher [MVP-Outlook]" wrote:
>> >
>> >> Delete it in what context? If you get the item's EntryID after saving
>> >> it
>> >> and
>> >> store that in your Access database, you can return the same item with
>> >> the
>> >> Namespace.GetItemFromID and then delete it with the
>> >> AppointmentItem.Delete
>> >> method.
>> >>
>> >>
>> >> "Andy" <(E-Mail Removed)> wrote in message
>> >> newsB7F9858-6C2B-4E9B-A3EF-(E-Mail Removed)...
>> >> >I have successfully added an All Day appointment for tomorrow in
>> >> >Outlook
>> >> >from
>> >> > Access using :-
>> >> >
>> >> > --------------
>> >> >
>> >> > Dim objOutlook As Outlook.Application
>> >> > Dim objCalendar As Object
>> >> > Dim objAppointment As Object
>> >> >
>> >> > Set objOutlook = New Outlook.Application
>> >> > Set objCalendar =
>> >> > objOutlook.Session.GetDefaultFolder(olFolderCalendar)
>> >> >
>> >> > Set objAppointment = objCalendar.Items.Add
>> >> > With objAppointment
>> >> > .Subject = "Test"
>> >> > .Start = Date + 1
>> >> > .AllDayEvent = True
>> >> > End With
>> >> > objAppointment.Close olSave
>> >> > Set objAppointment = Nothing
>> >> > Set objOutlook = Nothing
>> >> >
>> >> > ---------
>> >> >
>> >> > Can anyone help me with the code to delete the same appointment
>> >> > using
>> >> > VBA?
>> >> >
>> >> > Thanks.
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?QW5keQ==?=
Guest
Posts: n/a
 
      10th Jan 2005
Thanks Sue - Here is cut down code as requested [ it does the add's OK but
not the delete's - fails on Set objAppointment =
objOutlook.Session.GetItemFromID(CalEntryID) ] :-

Dim objOutlook As Outlook.Application
Dim objCalendar As Object
Dim objAppointment As Object
Dim CalEntryID as Variant
Dim CalEntryIDR as Object
Dim SQLcmd as String

Set objOutlook = New Outlook.Application
Set objCalendar = objOutlook.Session.GetDefaultFolder(olFolderCalendar)

Select Case Action

Case "A"

cc = 0

Do While cc <= 2

Set objAppointment = objCalendar.Items.Add
With objAppointment
.Subject = "Test"
.Start = Date + cc
.AllDayEvent = True
End With

objAppointment.Close olSave

CalEntryID = objAppointment.EntryID

SQLcmd = "Insert into table tblx (EN,EI) values ('" & cc & "', '" &
CalEntryID & "')"
Docmd.RunSQL SQLcmd

cc = cc + 1

Loop

Case "D"

cc = 0

Do While cc <= 2

CalEntryID = DLookup("[EI]", "tblx", "[EN] = " & cc)
Set objAppointment = objOutlook.Session.GetItemFromID(CalEntryID)
objAppointment.Delete

cc = cc + 1

Loop

End Select

Set objAppointment = Nothing
Set objOutlook = Nothing


---------

"Sue Mosher [MVP-Outlook]" wrote:

> Show the code used to instantiate the Namespace and to save the items and
> get their EntryIDs.
>
> GetItemFromID returns an object. You need to use Set:
>
> Set CalEntryIDR = objNS.GetItemFromID(CalEntryID)
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "Andy" <(E-Mail Removed)> wrote in message
> news:F52F1C45-D96D-416F-8B3F-(E-Mail Removed)...
> > Sue - Sorry to push a bit more on this subject but it is interesting.
> > Firstly, I took your advice and looked at the VBA help files to work out
> > the
> > syntax of the various methods. I did struggle with Namespace though and
> > found
> > that I had to use Session instead.
> >
> > Anyway - I created 3 Appointment items one after the other and saved each
> > before obtaining their EntryID - suprisingly each EntryID was the same
> > even
> > though the 3 appointments were on different days albeit with the same
> > Subject
> > for each.
> >
> > I stored these away but when I came to later use them to delete the
> > appointments, I got a failure when I tried to set a variable as follows :-
> >
> > CalEntryIDR = objOutlook.Session.GetItemFromID(CalEntryID) ' CalEntryID is
> > the long EntryID value
> >
> > Also when I actually got this statement to work (just after creating the
> > appointment) the returned value was the Subject of the appointment ???
> >
> > Any ideas? Especially the difference between Namespace and Session and why
> > the 3 IDs were the same above.
> >
> > Thanks.
> >
> > The variable CalEntryID contains the long EntryID value.
> > "Sue Mosher [MVP-Outlook]" wrote:
> >
> >> When in doubt, check the object browser: Press ALt+F11 to open the VBA
> >> environment in Outlook, then press F2. Switch from <All Libraries> to
> >> Outlook to browse all Outlook objects and their properties, methods, and
> >> events. Select any object or member, then press F1 to see its Help topic.
> >>
> >> "Andy" <(E-Mail Removed)> wrote in message
> >> news:56FDB3C3-9810-4877-A442-(E-Mail Removed)...
> >> > Thanks Sue - good idea.
> >> >
> >> > I'm OK with obtaining and storing the EntryID for later use but could
> >> > you
> >> > help more with the syntax with Namespace.GetItemFromID and
> >> > AppointmentItem.Delete - I'm not so familar with these two contructs.
> >> >
> >> > Regards - Andy.
> >> >
> >> > "Sue Mosher [MVP-Outlook]" wrote:
> >> >
> >> >> Delete it in what context? If you get the item's EntryID after saving
> >> >> it
> >> >> and
> >> >> store that in your Access database, you can return the same item with
> >> >> the
> >> >> Namespace.GetItemFromID and then delete it with the
> >> >> AppointmentItem.Delete
> >> >> method.
> >> >>
> >> >>
> >> >> "Andy" <(E-Mail Removed)> wrote in message
> >> >> newsB7F9858-6C2B-4E9B-A3EF-(E-Mail Removed)...
> >> >> >I have successfully added an All Day appointment for tomorrow in
> >> >> >Outlook
> >> >> >from
> >> >> > Access using :-
> >> >> >
> >> >> > --------------
> >> >> >
> >> >> > Dim objOutlook As Outlook.Application
> >> >> > Dim objCalendar As Object
> >> >> > Dim objAppointment As Object
> >> >> >
> >> >> > Set objOutlook = New Outlook.Application
> >> >> > Set objCalendar =
> >> >> > objOutlook.Session.GetDefaultFolder(olFolderCalendar)
> >> >> >
> >> >> > Set objAppointment = objCalendar.Items.Add
> >> >> > With objAppointment
> >> >> > .Subject = "Test"
> >> >> > .Start = Date + 1
> >> >> > .AllDayEvent = True
> >> >> > End With
> >> >> > objAppointment.Close olSave
> >> >> > Set objAppointment = Nothing
> >> >> > Set objOutlook = Nothing
> >> >> >
> >> >> > ---------
> >> >> >
> >> >> > Can anyone help me with the code to delete the same appointment
> >> >> > using
> >> >> > VBA?
> >> >> >
> >> >> > Thanks.
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
=?Utf-8?B?QW5keQ==?=
Guest
Posts: n/a
 
      12th Jan 2005
I eventually figured out why the deletes weren't working.

Below, when I stored the EntryID away in the database I hadn't realised that
the default size of a text field in Access is 50 characters. The EntryID is
much more than this (about 160 chrs) so the ID's were being truncated.
By increasing the size of the text field the ID's were stored correctly so
when they were retieved in order to delete the appointment at a later date,
it worked fine.
So the code was OK.

Andy.


-----------
"Andy" wrote:

> Thanks Sue - Here is cut down code as requested [ it does the add's OK but
> not the delete's - fails on Set objAppointment =
> objOutlook.Session.GetItemFromID(CalEntryID) ] :-
>
> Dim objOutlook As Outlook.Application
> Dim objCalendar As Object
> Dim objAppointment As Object
> Dim CalEntryID as Variant
> Dim CalEntryIDR as Object
> Dim SQLcmd as String
>
> Set objOutlook = New Outlook.Application
> Set objCalendar = objOutlook.Session.GetDefaultFolder(olFolderCalendar)
>
> Select Case Action
>
> Case "A"
>
> cc = 0
>
> Do While cc <= 2
>
> Set objAppointment = objCalendar.Items.Add
> With objAppointment
> .Subject = "Test"
> .Start = Date + cc
> .AllDayEvent = True
> End With
>
> objAppointment.Close olSave
>
> CalEntryID = objAppointment.EntryID
>
> SQLcmd = "Insert into table tblx (EN,EI) values ('" & cc & "', '" &
> CalEntryID & "')"
> Docmd.RunSQL SQLcmd
>
> cc = cc + 1
>
> Loop
>
> Case "D"
>
> cc = 0
>
> Do While cc <= 2
>
> CalEntryID = DLookup("[EI]", "tblx", "[EN] = " & cc)
> Set objAppointment = objOutlook.Session.GetItemFromID(CalEntryID)
> objAppointment.Delete
>
> cc = cc + 1
>
> Loop
>
> End Select
>
> Set objAppointment = Nothing
> Set objOutlook = Nothing
>
>
> ---------
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
> > Show the code used to instantiate the Namespace and to save the items and
> > get their EntryIDs.
> >
> > GetItemFromID returns an object. You need to use Set:
> >
> > Set CalEntryIDR = objNS.GetItemFromID(CalEntryID)
> >
> > --
> > Sue Mosher, Outlook MVP
> > Author of
> > Microsoft Outlook Programming - Jumpstart for
> > Administrators, Power Users, and Developers
> > http://www.outlookcode.com/jumpstart.aspx
> >
> >
> > "Andy" <(E-Mail Removed)> wrote in message
> > news:F52F1C45-D96D-416F-8B3F-(E-Mail Removed)...
> > > Sue - Sorry to push a bit more on this subject but it is interesting.
> > > Firstly, I took your advice and looked at the VBA help files to work out
> > > the
> > > syntax of the various methods. I did struggle with Namespace though and
> > > found
> > > that I had to use Session instead.
> > >
> > > Anyway - I created 3 Appointment items one after the other and saved each
> > > before obtaining their EntryID - suprisingly each EntryID was the same
> > > even
> > > though the 3 appointments were on different days albeit with the same
> > > Subject
> > > for each.
> > >
> > > I stored these away but when I came to later use them to delete the
> > > appointments, I got a failure when I tried to set a variable as follows :-
> > >
> > > CalEntryIDR = objOutlook.Session.GetItemFromID(CalEntryID) ' CalEntryID is
> > > the long EntryID value
> > >
> > > Also when I actually got this statement to work (just after creating the
> > > appointment) the returned value was the Subject of the appointment ???
> > >
> > > Any ideas? Especially the difference between Namespace and Session and why
> > > the 3 IDs were the same above.
> > >
> > > Thanks.
> > >
> > > The variable CalEntryID contains the long EntryID value.
> > > "Sue Mosher [MVP-Outlook]" wrote:
> > >
> > >> When in doubt, check the object browser: Press ALt+F11 to open the VBA
> > >> environment in Outlook, then press F2. Switch from <All Libraries> to
> > >> Outlook to browse all Outlook objects and their properties, methods, and
> > >> events. Select any object or member, then press F1 to see its Help topic.
> > >>
> > >> "Andy" <(E-Mail Removed)> wrote in message
> > >> news:56FDB3C3-9810-4877-A442-(E-Mail Removed)...
> > >> > Thanks Sue - good idea.
> > >> >
> > >> > I'm OK with obtaining and storing the EntryID for later use but could
> > >> > you
> > >> > help more with the syntax with Namespace.GetItemFromID and
> > >> > AppointmentItem.Delete - I'm not so familar with these two contructs.
> > >> >
> > >> > Regards - Andy.
> > >> >
> > >> > "Sue Mosher [MVP-Outlook]" wrote:
> > >> >
> > >> >> Delete it in what context? If you get the item's EntryID after saving
> > >> >> it
> > >> >> and
> > >> >> store that in your Access database, you can return the same item with
> > >> >> the
> > >> >> Namespace.GetItemFromID and then delete it with the
> > >> >> AppointmentItem.Delete
> > >> >> method.
> > >> >>
> > >> >>
> > >> >> "Andy" <(E-Mail Removed)> wrote in message
> > >> >> newsB7F9858-6C2B-4E9B-A3EF-(E-Mail Removed)...
> > >> >> >I have successfully added an All Day appointment for tomorrow in
> > >> >> >Outlook
> > >> >> >from
> > >> >> > Access using :-
> > >> >> >
> > >> >> > --------------
> > >> >> >
> > >> >> > Dim objOutlook As Outlook.Application
> > >> >> > Dim objCalendar As Object
> > >> >> > Dim objAppointment As Object
> > >> >> >
> > >> >> > Set objOutlook = New Outlook.Application
> > >> >> > Set objCalendar =
> > >> >> > objOutlook.Session.GetDefaultFolder(olFolderCalendar)
> > >> >> >
> > >> >> > Set objAppointment = objCalendar.Items.Add
> > >> >> > With objAppointment
> > >> >> > .Subject = "Test"
> > >> >> > .Start = Date + 1
> > >> >> > .AllDayEvent = True
> > >> >> > End With
> > >> >> > objAppointment.Close olSave
> > >> >> > Set objAppointment = Nothing
> > >> >> > Set objOutlook = Nothing
> > >> >> >
> > >> >> > ---------
> > >> >> >
> > >> >> > Can anyone help me with the code to delete the same appointment
> > >> >> > using
> > >> >> > VBA?
> > >> >> >
> > >> >> > Thanks.
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >>
> > >> >>
> > >> >>
> > >>
> > >>
> > >>

> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Appointment will not delete David C. Holley Microsoft Outlook Discussion 1 23rd Oct 2009 03:10 PM
How delete appointment without scan app the existing appointment Yanshof Microsoft Outlook Calendar 1 2nd Mar 2009 03:04 PM
Delete appointment from still pop up =?Utf-8?B?TGFpIFRlY2sgQ2hvbmc=?= Microsoft Outlook Discussion 0 12th Jun 2007 02:44 AM
Delete Appointment (C#) guileao Microsoft Outlook Interoperability 0 22nd Sep 2005 05:53 PM
How to get the currently selected appointment start & enddate of a single appointment in a recurring appointment series? Fredrik Nelson Microsoft Outlook VBA Programming 0 29th Apr 2004 04:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:53 PM.