I am working in VB.NET trying to attach to a folder within a user’s account that has a specific word in the Description field. In this particular case this folder will always be a calendar folder, but not always the user’s main calendar.
This should be simple enough with a search filter, but to use one I need the correct extended property definition. From what I can tell this should be PR_COMMENT_W (0x3004001F), but I cant seem to figure out how to adapt that to the New ExtendedPropertyDefinition Class. Something like:
Dim TagComment As ExtendedPropertyDefinition = New ExtendedPropertyDefinition(0x3004001F, MapiPropertyType.String)
Dim view As New FolderView(10)
view.PropertySet = New PropertySet(BasePropertySet.IdOnly)
view.PropertySet.Add(TagComment)
Dim searchFilter As SearchFilter = New SearchFilter.ContainsSubstring(TagComment, "WordToFind")
Dim results As FindFoldersResults = Service.FindFolders(New FolderId(WellKnownFolderName.Root, New Mailbox("EmailAddress")), searchFilter, view)
That works =)