.Find fails for .Outlook._Items

S

S.Clark

The last line of this code errors out. Any clues?

oApp = New Microsoft.Office.Interop.Outlook.Application()
oNS = oApp.GetNamespace("MAPI")
oNS.Logon(Missing.Value, Missing.Value, True, True)

Dim oCt As Microsoft.Office.Interop.Outlook.ContactItem
Dim objconts As Microsoft.Office.Interop.Outlook._Items = targetFolder.Items

oCt = objconts.Find("[CustomerID]='" & strID & "'")

===

Error Info:
Message = "The operation failed"
ErrorCode = -142589947
 
B

Brian Tillman [MVP - Outlook]

S.Clark said:
The last line of this code errors out. Any clues?

oApp = New Microsoft.Office.Interop.Outlook.Application()
oNS = oApp.GetNamespace("MAPI")
oNS.Logon(Missing.Value, Missing.Value, True, True)

Dim oCt As Microsoft.Office.Interop.Outlook.ContactItem
Dim objconts As Microsoft.Office.Interop.Outlook._Items =
targetFolder.Items

oCt = objconts.Find("[CustomerID]='" & strID & "'")

===

Error Info:
Message = "The operation failed"
ErrorCode = -142589947

Ask in the programming group microsoft.public.outlook.program_vba
 
Top