Find Fax Number

  • Thread starter Thread starter Brad
  • Start date Start date
B

Brad

Thanks for taking the time to read my question.

I am trying to find a contact in my contact folder, and
retun the BusinessFaxNumber once the contact is found.

I found this code in the help section, but can't seem to
do anything with it.

Thanks again for the help.

Brad

Public Sub Test()
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNameSpace.GetDefaultFolder
(olFolderContacts)
Set myItem = myContacts.Items.Find("[FullName] = ""a
first and last name goes here""")

'If it finds the contact record, I'd like to find out the
BusinessFaxNumber for that contact.
'How do I do that?

End Sub
 
Hi Sue,

Thanks for the tip. I have been using it, and I can't
seem to find and solutions.

Brad
-----Original Message-----
myItem.BusinessFaxNumber

When in doubt, check the object browser: Press ALt+F11 to open the VBA
environment in Outlook, then press F2. Also see
http://www.slipstick.com/dev/propsyntax.htm for details on the syntax for
accessing built-in and custom properties.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Thanks for taking the time to read my question.

I am trying to find a contact in my contact folder, and
retun the BusinessFaxNumber once the contact is found.

I found this code in the help section, but can't seem to
do anything with it.

Thanks again for the help.

Brad

Public Sub Test()
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNameSpace.GetDefaultFolder
(olFolderContacts)
Set myItem = myContacts.Items.Find("[FullName] = ""a
first and last name goes here""")

'If it finds the contact record, I'd like to find out the
BusinessFaxNumber for that contact.
'How do I do that?

End Sub


.
 
Hi Sue,

I forgot to mention that as I step through the code using
F8, I watch the Locals Window. myItem has <No
Variables>. Does that mean my Find is returning nothing,
and therefore it is not possible to ask for the
BusinessFaxNumber?

Thanks again, I really appreciate all of your help.

Brad
-----Original Message-----
myItem.BusinessFaxNumber

When in doubt, check the object browser: Press ALt+F11 to open the VBA
environment in Outlook, then press F2. Also see
http://www.slipstick.com/dev/propsyntax.htm for details on the syntax for
accessing built-in and custom properties.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Thanks for taking the time to read my question.

I am trying to find a contact in my contact folder, and
retun the BusinessFaxNumber once the contact is found.

I found this code in the help section, but can't seem to
do anything with it.

Thanks again for the help.

Brad

Public Sub Test()
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNameSpace.GetDefaultFolder
(olFolderContacts)
Set myItem = myContacts.Items.Find("[FullName] = ""a
first and last name goes here""")

'If it finds the contact record, I'd like to find out the
BusinessFaxNumber for that contact.
'How do I do that?

End Sub


.
 
Quite possibly. You should always check Find actually returns an item:

Set objItem = colItems.Find(strSearch)
If Not objItem Is Nothing Then
' your code to work with objItem goes here
Else
MsgBox "The search criteria " & vbCrLf & vbCrLf & _
strSearch & vbCrLf & vbCrLf & _
" returned no item."
End If
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Hi Sue,

I forgot to mention that as I step through the code using
F8, I watch the Locals Window. myItem has <No
Variables>. Does that mean my Find is returning nothing,
and therefore it is not possible to ask for the
BusinessFaxNumber?
-----Original Message-----
myItem.BusinessFaxNumber

Thanks for taking the time to read my question.

I am trying to find a contact in my contact folder, and
retun the BusinessFaxNumber once the contact is found.

I found this code in the help section, but can't seem to
do anything with it.

Thanks again for the help.

Brad

Public Sub Test()
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNameSpace.GetDefaultFolder
(olFolderContacts)
Set myItem = myContacts.Items.Find("[FullName] = ""a
first and last name goes here""")

'If it finds the contact record, I'd like to find out the
BusinessFaxNumber for that contact.
'How do I do that?

End Sub


.
 
Back
Top