Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Word, PowerPoint, Outlook, and Other Office Products > SMTP from Global Address List -- thought I was there


Reply
 
Thread Tools Display Modes
  #1  
Old 03-18-2003, 02:08 PM
strBean's Avatar
strBean strBean is offline
Junior Contributor
 
Join Date: May 2002
Location: Rural Northwest USA
Posts: 315
Default SMTP from Global Address List -- thought I was there


I'm trying to use VBA to get the SMTP address out of our Exchange Server 5.5. First, looking at the properties of the AddressEntry object, I see there isn't a simple way to do this. So, I start to play with the .Address property, and I see that the parts of the SMTP address are buried in the internal address string:
/o=blah.blah/ou=blah/cn=blah blah blah/cn=UserName
At first, I thought I could parse out and concat the SMTP from this. However, there are flaws in the consistency of how this string is put together. I did a search here, and found a few threads , but the only suggestion was to use CDO. The help I found seemed to be all about using VBScript in Outlook. I want to use VBA in Access to build records for a table.

Any clues? Anything you can point me to?








*
Reply With Quote
  #2  
Old 03-18-2003, 04:48 PM
strBean's Avatar
strBean strBean is offline
Junior Contributor
 
Join Date: May 2002
Location: Rural Northwest USA
Posts: 315
Default

Well, I didn't know it, but some of the code I've borrowed in this effort is CDO. In the Outlook GUI, the Properties sheet for each AddressEntry in the GAL has a tab -- Email Addresses. On that tab is a listbox that shows, among other things, the SMTP address. Realizing that the Library offered by Outlook for automation does not include a full object model, I guess my question is, is the Outlook client GUI the only way to see this data?




*
Reply With Quote
  #3  
Old 03-19-2003, 11:27 AM
JordanChris JordanChris is offline
Senior Contributor

* Expert *
 
Join Date: Jan 2003
Location: Newbury, UK
Posts: 1,092
Default

ADSI, CDO and other Exchange directory oriented API's will allow you to look at that information (I believe).
CDOLive.com or Slipstick.com would be the 2 sites I would try (after the MS Knowledge base).

As you have found out, you are at the limit of knowledge here - so you will need to do some careful digging and searching....

You will not (unless you are very lucky with the Exchange set-up and configuration) be able to get a valid SMTP address from the \CN= format.
Reply With Quote
  #4  
Old 03-19-2003, 12:52 PM
strBean's Avatar
strBean strBean is offline
Junior Contributor
 
Join Date: May 2002
Location: Rural Northwest USA
Posts: 315
Default

Well, I was lucky a few times, getting valid SMTP addresses from that string. Got my hopes up. Oh well. I'll check the sites you mentioned.

thx!



*
Reply With Quote
  #5  
Old 03-19-2003, 01:44 PM
Wamphyri's Avatar
Wamphyri Wamphyri is offline
Variable not defined

Retired Moderator
* Guru *
 
Join Date: Apr 2002
Location: Ottawa, Ontario
Posts: 4,793
Default

Quote:
Originally Posted by strBean
Well, I was lucky a few times, getting valid SMTP addresses from that string. Got my hopes up. Oh well. I'll check the sites you mentioned.
Hey strBean,

How have you been? Would you mind giving me some examples of ones that you didn't get valid addresses for. I'll take a look and see if I can give you the valid SMTP address back. If you want you can send them by PM.
__________________
-Carl
Reply With Quote
  #6  
Old 03-19-2003, 01:51 PM
strBean's Avatar
strBean strBean is offline
Junior Contributor
 
Join Date: May 2002
Location: Rural Northwest USA
Posts: 315
Default

Hey! Carl, not too bad, h'bout y'self?

Yes, I'd be happy to PM a bunch of Address strings to you, if you want to puzzle & parse.

Thanks!
Reply With Quote
  #7  
Old 03-19-2003, 02:08 PM
Wamphyri's Avatar
Wamphyri Wamphyri is offline
Variable not defined

Retired Moderator
* Guru *
 
Join Date: Apr 2002
Location: Ottawa, Ontario
Posts: 4,793
Default

Quote:
Originally Posted by strBean
Hey! Carl, not too bad, h'bout y'self?
Yes, I'd be happy to PM a bunch of Address strings to you, if you want to puzzle & parse.
Thanks!
Pretty good.
I'm expecting to be working on something like this in a few weeks, and the initials tests that I've done at my work have all worked out fine. Getting some possible problem ones are just what I'm looking for.
__________________
-Carl
Reply With Quote
  #8  
Old 03-19-2003, 02:10 PM
strBean's Avatar
strBean strBean is offline
Junior Contributor
 
Join Date: May 2002
Location: Rural Northwest USA
Posts: 315
Default

Quote:
Originally Posted by Wamphyri
Pretty good.
I'm expecting to be working on something like this in a few weeks, and the initials tests that I've done at my work have all worked out fine.
Probably because at your organization, there is a clearer configuration standard.

PM follows!
Reply With Quote
  #9  
Old 03-19-2003, 02:26 PM
strBean's Avatar
strBean strBean is offline
Junior Contributor
 
Join Date: May 2002
Location: Rural Northwest USA
Posts: 315
Default

You know, Outlook displays a "properties" sheet for each AddressEntry. There's a tab that says "E-mail Addresses" and it's a listbox with various values, one of which is "smtp: (emailaddress)"

I get the distinct feeling that the object in MS Exchange (where these "properties" comes from) is not exposed by the CDO model. Somebody prove me wrong, please.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EMAIL ADDRESS FORMAT for Exchange Global Address Book Adresses ohmyigod Communications 5 05-02-2003 10:34 AM
Global Address List florida Web Programming 2 01-21-2003 05:16 AM
global address list retrieval Sentient Communications 5 12-11-2001 02:53 AM
MS Winsocket gibson General 3 07-20-2001 11:03 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->