How do I delete an appointment using vbscript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've created a script that adds an appointment but now need the ability to
delete that appointment if the situation changes? How do I do that?
 
I suppose I should add the script that I used to create the item in the first
place.

Sub test()

Set obj = CreateObject("outlook.application")
Set app = obj.CreateItem(1) ' means outlook appointment item

app.Duration = getfield("Duration","value")
app.Location = Eworkgetfield("Location","value")
app.MeetingStatus = 1
app.Body = Eworkgetfield("Comments","value")

a = eworkGetField("DueDate","Value")
'a=(getfield ("DateTime",""))
b=mid(a,1,4)+ "/"+mid(a,6,2)+"/"+mid(a,9,2)+ " "+ mid(a,12,2)+":" +
mid(a,15,2)
app.Start = cdate(b)
'msgbox app.Start

'app.Recipients.Add(cstr(getfield("recipients","value")))
app.RequiredAttendees =cstr(getfield("OutlookList","value"))

app.Subject = Eworkgetfield("mDescription","value")
app.send
app.save

Set app = Nothing
Set obj = Nothing

End Sub
 
The real issue is: What information will let you "find" that particular appointment again? That's a question only you can answer in the context of your specific application.

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
You're exactly right. I can pass variables, but what variables to pass?

I appreciate the link. I'll head on down that way.

Thanks.
 
No fair: That's the question I was asking. <g> You're the only one at this point who knows enough about your application to decide. If you don't expect the appointment to ever move, you can get the item's EntryID property after you save it and store that, then use it with the Namespace.GetItemFromID method to return that appointment.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top