.Find fails for .Outlook._Items

  • Thread starter Thread starter S.Clark
  • Start date Start date
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
 
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
 
Back
Top