.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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top