A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Searching Contacts on a UserProperty



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 26th 09, 03:09 PM posted to microsoft.public.outlook.program_vba
McKilty
external usenet poster
 
Posts: 11
Default Searching Contacts on a UserProperty

I'm trying to update a routine that will update out Outlook Recipients
lists with an employee database. I've added a custom field to the
contacts called EMPID. What I would like to do is search the contacts
for a specific Employee ID (EMPID) and then update it with the
information from the database.

I'm unable to search on this field apparently:


Error: -659423223
The property "EMPID" is unknown.


Dim myFolder As Outlook.MAPIFolder
Dim myNameSpace As Outlook.NameSpace
Dim myOutlook As Outlook.Application
Dim myPublicContact As Outlook.ContactItem

Set myOutlook = CreateObject("Outlook.Application." & Val(Left
(Outlook.Version, 2)))
Set myNameSpace = myOutlook.GetNamespace("MAPI")
myNameSpace.Logon
Set myFolder = myNameSpace.Folders("Public Folders").Folders("All
Public Folders").Folders("Contacts").Folders("Recipients List")
Set myPublicContact = myFolder.Items.Find("[EMPID] = ""472""")

Ads
  #2  
Old February 26th 09, 03:29 PM posted to microsoft.public.outlook.program_vba
McKilty
external usenet poster
 
Posts: 11
Default Searching Contacts on a UserProperty

Ok, I finally found the answer. I had been searching for awhile
before posting, then I posted and continued to search, and found the
answer.

I had to create the UserProperty for the folder, not on a specific
item. I did this and went to a user and the property wasn't there.
It was in the folder view that I had, so I just went down the list and
added the value and then it was searchable. Pretty odd...

Anything else I should know about this?
  #3  
Old February 26th 09, 04:52 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Searching Contacts on a UserProperty

You can also use the SQL syntax when calling Find and specify the property
name in the DASL format

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"McKilty" wrote in message
...
Ok, I finally found the answer. I had been searching for awhile
before posting, then I posted and continued to search, and found the
answer.

I had to create the UserProperty for the folder, not on a specific
item. I did this and went to a user and the property wasn't there.
It was in the folder view that I had, so I just went down the list and
added the value and then it was searchable. Pretty odd...

Anything else I should know about this?



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
searching contacts biggie Outlook - Using Contacts 5 May 19th 08 09:06 PM
Searching contacts using keystrokes Tony[_4_] Outlook - Using Contacts 0 February 28th 08 03:37 PM
Searching Notes in Contacts nikitab Outlook - Using Contacts 4 February 8th 08 11:38 PM
trying to move contacts-searching did not help bspeed Outlook - Using Contacts 1 January 9th 08 01:48 PM
Searching Contacts and sub folders MCA Outlook - Using Contacts 2 January 19th 06 08:26 AM


All times are GMT +1. The time now is 04:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.