P
Peter Osawa
Hi, I'm trying to retreive outlook contact info with the phone number...
I code this with Option Strict On:
Dim myApp As New Outlook.Application
Dim contact As Outlook.ContactItem
Dim espace As Outlook.NameSpace
Dim contacts As Outlook.MAPIFolder
myApp = New Outlook.Application
espace = myApp.GetNamespace("MAPI")
contacts = espace.GetDefaultFolder(OlDefaultFolders.olFolderContacts)
contact = contacts.Items.Find("[BusinessTelephoneNumber]=0558XXXX") <<<---
Error
Me.Text = contact.FullName
And I have this error:
Option Strict On disallows implicit conversions from 'System.Object' to
'Outlook.ContactItem'.
I know Strict option is used for not melting types, but I don't know how
declare contact...
Any help ?
TIA
I code this with Option Strict On:
Dim myApp As New Outlook.Application
Dim contact As Outlook.ContactItem
Dim espace As Outlook.NameSpace
Dim contacts As Outlook.MAPIFolder
myApp = New Outlook.Application
espace = myApp.GetNamespace("MAPI")
contacts = espace.GetDefaultFolder(OlDefaultFolders.olFolderContacts)
contact = contacts.Items.Find("[BusinessTelephoneNumber]=0558XXXX") <<<---
Error
Me.Text = contact.FullName
And I have this error:
Option Strict On disallows implicit conversions from 'System.Object' to
'Outlook.ContactItem'.
I know Strict option is used for not melting types, but I don't know how
declare contact...
Any help ?
TIA