sandriekus
Member
- Joined
- Apr 20, 2009
- Messages
- 9
- Programming Experience
- Beginner
Hello,
i want to delete automaticly some appointments in Outlook. this is the code that i have:
now it work good but the program only deletes de appointments where the subject is exactly textbox1.text. for example:
textbox1 = hello
appointment subject = hello i'm 21 years old
then the appointment will not remove!
so what i need is something like this (but it doesnt work):
Criteria = "[subject.indexof(textbox1.text)]<> -1"
can someone help me please
i want to delete automaticly some appointments in Outlook. this is the code that i have:
VB.NET:
Dim objOutlook As New Outlook.Application
Dim objNS As Outlook.NameSpace
Dim Appt As Object
Dim objInboxItems As Outlook.Items
Dim Criteria As String
objNS = objOutlook.GetNamespace("MAPI")
objInboxItems = objNS.GetDefaultFolder(9).Items
Criteria = "[subject]=" & textbox1.Text
Appt = objInboxItems.Find(Criteria)
Do While Not (Appt Is Nothing)
Appt.delete()
Appt = objInboxItems.FindNext
Loop
Appt = Nothing
objInboxItems = Nothing
objNS = Nothing
objOutlook = Nothing
now it work good but the program only deletes de appointments where the subject is exactly textbox1.text. for example:
textbox1 = hello
appointment subject = hello i'm 21 years old
then the appointment will not remove!
so what i need is something like this (but it doesnt work):
Criteria = "[subject.indexof(textbox1.text)]<> -1"
can someone help me please