I'm trying to delete an Outlook AppointmentItem for which I have the EntryID. Using late binding to avoid referencing a specific verison of Outlook.
Thefollowing code fails on myappt.delete with a 287 (Application defined or object defined error.):
Dim myAppt As Object 'AppointmentItem 'object
Dim myNS As Object 'NameSpace 'object
Dim myAppts As Object 'Items 'object
success = manageOutlookRef 'get a reference to Outlook
Set myNS = myOlApp.GetNamespace("MAPI")
Set myAppts = myNS.GetDefaultFolder(9).items '9=olFolderCalendar
Set myAppt = myNS.getItemFromID(OutID)
If Not myAppt Is Nothing Then
'delete it and stop
myAppt.Delete <<<<<<<FAILS HERE
UpdateStatusBar " Outlook Appointment deleted."
I can get the typeName, Class, subject of myAppt, but not its start, end or Outlookversion (?) What's wrong with my code? or whats a surefire way of doing this from VB6 (late bound)?
Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.
I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function. While writing that article I realized that no o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…