When I run this code in Access:
I get the message:Code:Public Sub OpenOutlookEmail(ByVal strEntryID As String) Dim objOutlook As Outlook.Application Dim objNameSpace As Outlook.NameSpace Dim objCSIFolder As Outlook.MAPIFolder Dim objDisplayEmail As Outlook.MailItem Dim objFolders As Outlook.Folders Set objOutlook = New Outlook.Application Set objNameSpace = objOutlook.GetNamespace("MAPI") Set objFolders = objNameSpace.Folders Set objCSIFolder = OpenOutlookFolder("Public Folders\All Public Folders\A\B\C\D", objFolders) Set objDisplayEmail = objCSIFolder.Items.Find("[EntryID] = '" & strEntryID & "'") If TypeName(objDisplayEmail) <> "Nothing" Then objDisplayEmail.Display 'THE USE CAN MAKE CHANGES AND SAVE THEM TO OUTLOOK Else MsgBox "Email not found in Outlook!", vbOKOnly + vbExclamation End If End Sub
Run-time error '-1214119927 (b7a20009)'
The property "EntryID" in the condition is not valid
I would be very grateful if someone could tell me where I have gone wrong. I have tried several permutations of filter


Reply With Quote