myItem.BusinessFaxNumber doesn't work

B

Brad

Thanks for taking the time to read my question.

I am trying to return the BusinessFaxNumber of a contact
by finding the contact by the FullName.

when I run the code below I get an error that says "The
object does not suppor this method" In the Locals
window, myItem has <No Variables>.

When I hold the cursor over myItem, the name I am looking
for is displayed.

Does this mean that nothing is being found?

Thanks again for the help.

Brad

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNameSpace.GetDefaultFolder
(olFolderContacts)

Set myItem = myContacts.Items.Find("[FullName] = ""Full
Name Here""")

myItem.BusinessFaxNumber
 
S

Sue Mosher [MVP]

Which statement produces that error?

Please see my response to youir earlier post.
 
B

Brad

myItem.BusinessFaxNumber produces the error.

Brad
-----Original Message-----
Which statement produces that error?

Please see my response to youir earlier post.
--
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 return the BusinessFaxNumber of a contact
by finding the contact by the FullName.

when I run the code below I get an error that says "The
object does not suppor this method" In the Locals
window, myItem has <No Variables>.

When I hold the cursor over myItem, the name I am looking
for is displayed.

Does this mean that nothing is being found?

Thanks again for the help.

Brad

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNameSpace.GetDefaultFolder
(olFolderContacts)

Set myItem = myContacts.Items.Find("[FullName] = ""Full
Name Here""")

myItem.BusinessFaxNumber


.
 
B

Brad

Hi Sue,

I added your code and there is a value in myItem. It is
equal to the vaue that the find is using to match to the
[FullName].

I got myItem.display to work. I am not sure why that
works, and the other commands don't.

Thanks again for all your great help,

Brad
-----Original Message-----
Which statement produces that error?

Please see my response to youir earlier post.
--
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 return the BusinessFaxNumber of a contact
by finding the contact by the FullName.

when I run the code below I get an error that says "The
object does not suppor this method" In the Locals
window, myItem has <No Variables>.

When I hold the cursor over myItem, the name I am looking
for is displayed.

Does this mean that nothing is being found?

Thanks again for the help.

Brad

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNameSpace.GetDefaultFolder
(olFolderContacts)

Set myItem = myContacts.Items.Find("[FullName] = ""Full
Name Here""")

myItem.BusinessFaxNumber


.
 
S

Sue Mosher [MVP]

I see what's happening. You didn't tell Outlook (or the rest of us) what you
wanted to do with myItem.BusinessFaxNumber. Display is a method: it makes
something happen to the item. BusinessFaxNumber is a property: it's just a
data value. If you want to return it to a variable, you have to set the
variable's value:

strFaxNo = myItem.BusinessFaxNumber

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Brad said:
Hi Sue,

I added your code and there is a value in myItem. It is
equal to the vaue that the find is using to match to the
[FullName].

I got myItem.display to work. I am not sure why that
works, and the other commands don't.

Thanks again for all your great help,

Brad
-----Original Message-----
Which statement produces that error?

Please see my response to youir earlier post.
--
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 return the BusinessFaxNumber of a contact
by finding the contact by the FullName.

when I run the code below I get an error that says "The
object does not suppor this method" In the Locals
window, myItem has <No Variables>.

When I hold the cursor over myItem, the name I am looking
for is displayed.

Does this mean that nothing is being found?

Thanks again for the help.

Brad

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNameSpace.GetDefaultFolder
(olFolderContacts)

Set myItem = myContacts.Items.Find("[FullName] = ""Full
Name Here""")

myItem.BusinessFaxNumber


.
 
G

Guest

Sue, Sue, Sue!!!

Thank you so much. It's so obveous now.

Thanks so much for your help!

Brad
-----Original Message-----
I see what's happening. You didn't tell Outlook (or the rest of us) what you
wanted to do with myItem.BusinessFaxNumber. Display is a method: it makes
something happen to the item. BusinessFaxNumber is a property: it's just a
data value. If you want to return it to a variable, you have to set the
variable's value:

strFaxNo = myItem.BusinessFaxNumber

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Hi Sue,

I added your code and there is a value in myItem. It is
equal to the vaue that the find is using to match to the
[FullName].

I got myItem.display to work. I am not sure why that
works, and the other commands don't.

Thanks again for all your great help,

Brad
-----Original Message-----
Which statement produces that error?

Please see my response to youir earlier post.
--
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 return the BusinessFaxNumber of a contact
by finding the contact by the FullName.

when I run the code below I get an error that says "The
object does not suppor this method" In the Locals
window, myItem has <No Variables>.

When I hold the cursor over myItem, the name I am looking
for is displayed.

Does this mean that nothing is being found?

Thanks again for the help.

Brad

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNameSpace.GetDefaultFolder
(olFolderContacts)

Set myItem = myContacts.Items.Find("[FullName] = ""Full
Name Here""")

myItem.BusinessFaxNumber


.


.
 

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