Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook EntryID

Status
Not open for further replies.

GaryDw

MIS
Oct 3, 2001
7
US
Hi All

I have written a VC++ DLL that creates an Appointment item
in Outlook and writes the item's EntryID to an outside
application.

I am now trying to write a DLL that will delete an
appointment. The function will be passed the EntryID.
Has anyone ever done this before or would know how to do
it. I am able to do this in VB, but fail miserably in
VC++. Your help will be greatly appreciated.

Gary
.

 
Sub DeleteFirstAppointment()
Dim myOlApp, myNameSpace, myFolder, myItem As Object
Dim myEntryString As String
Set myOlApp = CreateObject("Outlook.Application")
On Error Resume Next
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(9) 'Calendar
myEntryString = myFolder.Items(1).EntryID 'The First Item's EntryID
Call DeleteAppointment(myEntryString)
End Sub

Sub DeleteAppointment(MyID As String)
Dim myOlApp, myNameSpace, myItem As Object
Set myOlApp = CreateObject("Outlook.Application")
On Error Resume Next
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myItem = myNameSpace.GetItemFromID(MyID) 'get myItem from MyID
myItem.Delete
End Sub

ide
 
Thanks ide.

However, I need a sample for VC++. I realize that this may not be the right forum for a VC++ question, but I am taking a chance that someone here may have written this type of function in VC++.

Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top