![]() |
| 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. |
|
|||||||
| Tags: address, check, email, internal, valid |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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 | |
|
|
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 |