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

Comparing external list of names to contact entries?



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old March 26th 09, 06:12 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Comparing external list of names to contact entries?


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:

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

 




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
Comparing an external list of names with contacts Dan Trimble Outlook - Using Contacts 1 March 26th 09 11:50 AM
Distribution list versus contact entries Jim D Outlook - General Queries 3 October 28th 08 03:27 AM
How to print list of journal entries by contact Gabrielle Outlook - Using Contacts 0 October 18th 07 05:54 AM
Icons before the names in my contact list churchadministrator Outlook - Using Contacts 1 June 5th 07 07:21 PM
Number of entries in a shared contact list Steve1073 Outlook - Using Contacts 0 March 23rd 07 09:20 PM


All times are GMT +1. The time now is 05:08 PM.


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.