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

Tags: , , , ,

Check for valid internal e-mail address





 
 
Thread Tools Display Modes
  #1  
Old July 25th 06, 05:30 PM posted to microsoft.public.outlook.program_vba
waxwing
external usenet poster
 
Posts: 6
Default Check for valid internal e-mail address

I've created a small app that takes an Excel spreadsheet which is
output from our employee scheduling system and e-mails appropriate
chunks to individual employees. In most cases, the name coming out of
the scheduling system is the same name used in our Exchange global
address book. That be the case, I am able to pluck the name, i.e. Doe,
John, from the Excel sheet and send the worksheet to Doe, John.

In a few cases, the name on the sheet may not be the same as in the
scheduling system. Does anyone have a snipit of code that would allow
me to check a string against the address book to determine if it
exists?

Thanks.

- John

Using Outlook 2003 and automating via Excel VBA. Very new to Outlook
programming.

Ads
  #2  
Old July 25th 06, 05:52 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Check for valid internal e-mail address

name = "Doe, John"

Set oOL = CreateObject("Outlook.Application")
Set recip = oOL.CreateRecipient(name)
If Not recip.Resolve Then
' name is not resolvable against the address book
ElseIf recip.AddressEntry.Type = "EX" Then
' name is an Exchange address book entry
End If

You could also use a Recipient object from a mail message, of course.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"waxwing" wrote in message oups.com...
I've created a small app that takes an Excel spreadsheet which is
output from our employee scheduling system and e-mails appropriate
chunks to individual employees. In most cases, the name coming out of
the scheduling system is the same name used in our Exchange global
address book. That be the case, I am able to pluck the name, i.e. Doe,
John, from the Excel sheet and send the worksheet to Doe, John.

In a few cases, the name on the sheet may not be the same as in the
scheduling system. Does anyone have a snipit of code that would allow
me to check a string against the address book to determine if it
exists?

Thanks.

- John

Using Outlook 2003 and automating via Excel VBA. Very new to Outlook
programming.

  #3  
Old July 25th 06, 06:38 PM posted to microsoft.public.outlook.program_vba
waxwing
external usenet poster
 
Posts: 6
Default Check for valid internal e-mail address

Thanks for the help Sue.

- John

Sue Mosher [MVP-Outlook] wrote:
name = "Doe, John"

Set oOL = CreateObject("Outlook.Application")
Set recip = oOL.CreateRecipient(name)
If Not recip.Resolve Then
' name is not resolvable against the address book
ElseIf recip.AddressEntry.Type = "EX" Then
' name is an Exchange address book entry
End If

You could also use a Recipient object from a mail message, of course.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"waxwing" wrote in message oups.com...
I've created a small app that takes an Excel spreadsheet which is
output from our employee scheduling system and e-mails appropriate
chunks to individual employees. In most cases, the name coming out of
the scheduling system is the same name used in our Exchange global
address book. That be the case, I am able to pluck the name, i.e. Doe,
John, from the Excel sheet and send the worksheet to Doe, John.

In a few cases, the name on the sheet may not be the same as in the
scheduling system. Does anyone have a snipit of code that would allow
me to check a string against the address book to determine if it
exists?

Thanks.

- John

Using Outlook 2003 and automating via Excel VBA. Very new to Outlook
programming.


 




Thread Tools
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
Internal email address disappear dsjk Outlook - General Queries 1 May 27th 06 01:42 AM
The difference between internal and external mail Frank Outlook - Installation 0 April 11th 06 11:22 AM
Can't send mail...parameter values not valid Par Outlook - General Queries 0 February 18th 06 06:01 PM
The check address pop up box changes the format of my addresses! HCSelf Outlook - Using Contacts 1 January 31st 06 10:41 PM
Why is "FAX" a valid e-mail type in address book? Opus Outlook - Using Contacts 3 January 13th 06 09:24 PM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Proxy - Mobile Phones - Books - Loan - Personal Loans