Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding Outlook Contacts
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00246888
Message ID:
00247575
Views:
18
No problem. Glad to help. And you're right, Outlook items are pretty exacting. When you're having trouble locating items, case sensitivity and sneaky blanks creeping in ( leading and/or trailing ) sre the first places I would look.

Bill

>Bill,
>
>Thanks for the time you took to check this out and reply. I found that you are right, outlook names are very sensitive. Case sensitivity was the problem. What is weird, is on some of the companyname(s) if I alltrim() my value it finds in and on some it will only find it if I don't alltrim() it. I have a cludge right now where I find for alltrim(.value) and if that is Null I find for the value and it works! Now I just need to find out why this is occuring, but I'm on the right track.
>
>Rob
>
>>I am having problems finding contacts in my public outlook folder. Here is the code:
>>
>>*********
>>oOutLookObject = CreateObject("Outlook.Application")
>>olNameSpace = oOutLookObject.GetNameSpace("MAPI")
>>
>>oContacts = ;
>> olNameSpace.Folders("Public Folders").;
>> Folders("All Public Folders").;
>> Folders("MIS Contacts").Items
>>
>>oContactItem = oContacts.Find("[CompanyName] = " + "'" + ThisForm.txtCompany.Value + "'")
>>
>>
>>*********
>>No matter what I have in txtCompany, oContactItem is NULL, even when the company DOES exist in the public MIS CONTACTS folder. I have also tried padr(ThisForm.txtCompany,255,' ') since Microsoft Developer Network says companyname is 255.
>>
>>Any advice would be appreciated. By the way, anyone know how sensitive the FIND is (ie case or length).
>>
>>Thanks in advance,
>>
>>Rob
>
>>I tried you basic example on my machine and it found names fine. I did not pad the Company Name. The things that have bitten me in the past are things like mis-spelled folder names ( Outlook names are case sensitive ) and one thing that really bit me once that if a folder name has leading or trailing spaces ( which are very hard to see and track down ) you must include them. I would look for these kinds of things to start with.
>
>>Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform