Find outlook appointment in public folder based on subject

dsk96m

Well-known member
Joined
Jan 11, 2013
Messages
173
Programming Experience
1-3
I am trying to find an item in a shared outlook calendar based on the subject. Here is my code:

VB.NET:
        olPublicFolder = olNameSpace.Folders("Public Folders")
        For i As Integer = 0 To calendarpath.Length - 1
            If calendarpath(i) <> "" And calendarpath(i) <> "Public Folders" Then
                olPublicFolder = olPublicFolder.Folders.Item(calendarpath(i))
            End If
        Next
        On Error Resume Next
        olAppt = olPublicFolder.Items.Find("[subject] like '*" & requestid & "*'")

My issue is with the last line. It is not finding it. if i put [subject]="The entire subject line", it works, but I am just trying to find the appointment with a specific item in the subject, basically it is ID=23 or whatever the number is, will always be unique. How can I do a find with a like statement or that contains that.
 
Top Bottom