ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Lookup an email address in Outlook based on Username (newbie quest (https://www.excelbanter.com/excel-programming/337735-lookup-email-address-outlook-based-username-newbie-quest.html)

hp

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.

Tom Ogilvy

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.




Richard Buttrey

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
__________________________

hp

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
__________________________


hp

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.






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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com