Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
hp hp is offline
external usenet poster
 
Posts: 13
Default Lookup an email address in Outlook based on Username (newbie quest

Hi,

Apologies if this question has been asked before - please direct to an
appropriate post if it has :-)

I have a column of usernames in an Excel spreadsheet and I would like to
find the corresponding email address by taking the username and doing a
lookup on all the email addresses in a global address list (by comparing the
username in the spreadsheet and username in Outlook, and returning the email
address if a match is found).

Anyone have any ideas how I could do this - or even if it is possible.

many thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Lookup an email address in Outlook based on Username (newbie quest

http://tinyurl.com/7fuly

should give you many ideas

--
Regards,
Tom Ogilvy

"HP" wrote in message
...
Hi,

Apologies if this question has been asked before - please direct to an
appropriate post if it has :-)

I have a column of usernames in an Excel spreadsheet and I would like to
find the corresponding email address by taking the username and doing a
lookup on all the email addresses in a global address list (by comparing

the
username in the spreadsheet and username in Outlook, and returning the

email
address if a match is found).

Anyone have any ideas how I could do this - or even if it is possible.

many thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 296
Default Lookup an email address in Outlook based on Username (newbie quest

On Fri, 19 Aug 2005 06:54:01 -0700, "HP"
wrote:

Hi,

Apologies if this question has been asked before - please direct to an
appropriate post if it has :-)

I have a column of usernames in an Excel spreadsheet and I would like to
find the corresponding email address by taking the username and doing a
lookup on all the email addresses in a global address list (by comparing the
username in the spreadsheet and username in Outlook, and returning the email
address if a match is found).

Anyone have any ideas how I could do this - or even if it is possible.

many thanks in advance.


I use this to identify whether a name in a Cell is to be found in an
Outlook contact list. No doubt you could modify it slightly to achieve
your task. I actually enclose it in a Loop so that the
range("emailname") changes each time.

Dim olApp As Outlook.Application
Dim myrecipient
Dim Txtto As String

Set olApp = New Outlook.Application
Txtto=range("emailname")
Set myrecipient = olMail.Recipients.Add(Txtto)
If myrecipient.Resolve Then
MsgBox "Valid eMail Name"
else: MsgBox "Invalid eMailName"
End if


HTH



__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
  #4   Report Post  
Posted to microsoft.public.excel.programming
hp hp is offline
external usenet poster
 
Posts: 13
Default Lookup an email address in Outlook based on Username (newbie q

Hi Richard,

Many thanks for your reply.
I tried your code and am getting the following error message: 'invalid
qualifier' and it is pointing to the line Set myrecipient =
olMail.Recipients.Add(Txtto)
I'm not too sure, but should olMail be set somewhere before this line?

cheers,
HP

"Richard Buttrey" wrote:

On Fri, 19 Aug 2005 06:54:01 -0700, "HP"
wrote:

Hi,

Apologies if this question has been asked before - please direct to an
appropriate post if it has :-)

I have a column of usernames in an Excel spreadsheet and I would like to
find the corresponding email address by taking the username and doing a
lookup on all the email addresses in a global address list (by comparing the
username in the spreadsheet and username in Outlook, and returning the email
address if a match is found).

Anyone have any ideas how I could do this - or even if it is possible.

many thanks in advance.


I use this to identify whether a name in a Cell is to be found in an
Outlook contact list. No doubt you could modify it slightly to achieve
your task. I actually enclose it in a Loop so that the
range("emailname") changes each time.

Dim olApp As Outlook.Application
Dim myrecipient
Dim Txtto As String

Set olApp = New Outlook.Application
Txtto=range("emailname")
Set myrecipient = olMail.Recipients.Add(Txtto)
If myrecipient.Resolve Then
MsgBox "Valid eMail Name"
else: MsgBox "Invalid eMailName"
End if


HTH



__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________

  #5   Report Post  
Posted to microsoft.public.excel.programming
hp hp is offline
external usenet poster
 
Posts: 13
Default Lookup an email address in Outlook based on Username (newbie q

Thanks Tom - looks like I may have found something that will do the trick.

cheers,
HP

"Tom Ogilvy" wrote:

http://tinyurl.com/7fuly

should give you many ideas

--
Regards,
Tom Ogilvy

"HP" wrote in message
...
Hi,

Apologies if this question has been asked before - please direct to an
appropriate post if it has :-)

I have a column of usernames in an Excel spreadsheet and I would like to
find the corresponding email address by taking the username and doing a
lookup on all the email addresses in a global address list (by comparing

the
username in the spreadsheet and username in Outlook, and returning the

email
address if a match is found).

Anyone have any ideas how I could do this - or even if it is possible.

many thanks in advance.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I link an email address in a cell to a MS Outlook template Jim Stevenson Excel Discussion (Misc queries) 1 February 24th 10 03:54 AM
Stop launching outlook when I click on an email address? Dagmaer Excel Discussion (Misc queries) 4 August 21st 07 09:58 PM
transfer email address cells from excel to outlook paul2006 Excel Discussion (Misc queries) 1 January 23rd 06 04:12 PM
worksheet email address to outlook xpress contact GMA Excel Worksheet Functions 1 July 24th 05 11:10 AM
Put Email Address from Excel to Outlook Terry Excel Programming 1 January 29th 04 08:40 AM


All times are GMT +1. The time now is 09:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"