Comparing external list of names to contact entries?

D

Dan Trimble

I have a list of names in an external file. Right now, it's an excel 2003
spreadsheet with separate columns for first name and last name, but I can
just as easily put it into Access, Word, text/CSV, etc. Each name on the
list corresponds to a contact in Outlook -- or it might not (some don't
exist, and don't need to).

I need a script or program that will compare the names *OR* File As fields
of each contact in Outlook with the external list. It does not need to
search any field other the names fields. If it doesn't exist, it can move on
to the next one. But if a contact entry in Outlook DOES exist for that name,
I need it to move the contact to another Outlook contacts folder. Or, at the
very least, flag it or assign it to a category. Then I could always filter
on that flag or category and move all of them at once by hand.

I've been doing this manually, one by one, and I'm tired :) There's about
3,800 names to get through, and I'm only on 1,219--after several hours of
doing this.

Anyone have any suggestions on how this can be done more efficiently? Is
there a script or program that can do it? I'm very technically inclined
(used to program, but it's been years and am not familiar with Outlook's
object model), and don't mind something fairly complicated, but I desparately
need to find some way to do this more efficiently/automated.

Dan
 
M

Michael Bauer [MVP - Outlook]

You can start with this. Please see the 'set c= ...' line, you need to
complete that yourself. The VBA helpfile explains how to use the Find
function, and there's already an example for searching for the FileAs field.

sub compare()
dim xl as excel.application
dim wb as excel.workbook
dim ws as excel.worksheet
dim rn as excel.range
dim f1 as outlook.mapifolder
dim f2 as outlook.mapifolder
dim items as outlook.items
dim c as outlook.contactitem

set xl=getobject(,"excel.application")
set wb=xl.workbooks(1)
set ws=wb.sheets(1)
set rn=ws.range("a1")

' compare with this contacts
set f1=application.session.pickfolder
set items=f1.items
' move to this
set f2=application.session.pickfolder

while rn.value <> ""
' please complete this yourself...
set c=items.find(...)

if not c is nothing then c.move f2
' move on to the next excel row
set rn=rn.offset(1,0)
wend
end sub

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Thu, 26 Mar 2009 10:44:17 -0700 schrieb Dan Trimble:
 

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