Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access / Validate email address against Exchange GAL

Status
Not open for further replies.

sparkbyte

Technical User
Sep 20, 2002
879
US
Anyone know a way to validate email addresses against the Exchange server GAL??

Without importing into access.

Thanks!!!!!

Thanks

John Fuhrman
faq329-6766
faq329-7301
thread329-1334328
thread329-1424438
 
I have a need where only requests from "valid" emails can be processed. In this case a 'valid' email is one that is listed in the Exchange Server GAL.

And yes this is VERY big. Requests for information come in from every state.

So what I want to be able to do is this.

Once a request has been input, the Contacts email address is then looked up in the Exchange GAL to make sure the person requesting the information is a current employee. If not, through an error message to the user stating the the email address is either invalid or not present in the GAL.


Thanks

John Fuhrman
faq329-6766
faq329-7301
thread329-1334328
thread329-1424438
 
Ah come on, someone has to know how to do this. I am not asking just to get a hand out. I have spent the past 3 weeks trying to find at least one example I could work from without any luck!!!

Could someone at least be kind enough to show me where to find an example??

Thanks!!!!!!!!!!!!!!!!!

Thanks

John Fuhrman
faq329-6766
faq329-7301
thread329-1334328
thread329-1424438
thread705-1592825
 
Here is as close as I can seem to get.

But it retrieves only the first instance of a name.

Code:
Function GetOutlookAddress(strContactName As String)
    Dim outApp As Object, outNS As Outlook.NameSpace
    Dim myAddressList As Outlook.AddressList
    
    Set outApp = CreateObject("Outlook.Application")
    Set outNS = outApp.GetNamespace("MAPI")
    Set myAddressList = outNS.Session.AddressLists("Global Address List")
    Set strUser = myAddressList.AddressEntries(strContactName)
     
'    Debug.Print myAddressList.AddressEntries("fuh")
'    Debug.Print "Name:.......... " & myAddressList.Name
'    Debug.Print "Application:... " & myAddressList.Application
'    Debug.Print "Class:......... " & myAddressList.Class
'    Debug.Print "ID:............ " & myAddressList.ID
'    Debug.Print "Index:......... " & myAddressList.Index
'    Debug.Print "Session:....... " & myAddressList.Session

'    Debug.Print "Session:....... " & myAddressList.Parent

'    Debug.Print "Name Search:... " & myAddressList.AddressEntries("fuhrman")

'    Debug.Print "Name Search:... " & myAddressList.AddressEntries(strContactName)
    
        Debug.Print strUser

    
    Set outApp = Nothing
     
End Function

If the myAddressList.AddressEntries(strContactName) is returning an array I cannot get it to display each entry using a for each loop.

Can someone help with this.. PLEEEEEAAAASSSSEEEE!!!!!!!!



Code:
Sub GetUserName()

Dim strName As String
    strName = InputBox(Prompt:="Your name please.", _
          title:="ENTER YOUR NAME", Default:="Your Name here")

Call GetOutlookAddress(strName)

'        If strName = "Your Name here" Or _
'           strName = vbNullString Then
'           Exit Sub
'        Else
'
''          Select Case strName
''            Case "Bob"
''                'Do Bobs stuff
''            Case "Bill"
''                'Do Bills stuff
''            Case "Mary"
''                'Do Marys stuff
''            Case Else
''                'Do other stuff
''          End Select
'
'
'
'        End If

End Sub

Thanks

John Fuhrman
faq329-6766
faq329-7301
thread329-1334328
thread329-1424438
thread705-1592825
 
You may have better luck in the VBA forum since this is really an Outlook not Access issue.
 
Well, I was needing the functionality for Access.

On the new contact form users put in the contacts email address and then are required to manually verify it against the Exchange GAL before they can process the incoming request. If the contact is not in the Exchange GAL the Rep's are not allowed to process the request. I would like to automate the GAL lookup and verify name and contact information against it.

Thanks

John Fuhrman
faq329-6766
faq329-7301
thread329-1334328
thread329-1424438
thread705-1592825
 
Yes but your issue is not with using the Access object model, but the Outlook OM. You could call this function from Excel, Word, PPT, Project, Outlook or VB. The fact that you use this in Access is not important. A lot of the same people respond on both forums, but there are a many Outlook experts in the VBA forum that are not regulars in here.
 
Is there a way to move this discussion to the VBA forum?
Or should I close this and repost in the VBA forum.

Thanks!!!

Thanks

John Fuhrman
faq329-6766
faq329-7301
thread329-1334328
thread329-1424438
thread705-1592825
 
Just repost in the VBA Forum. And then when you get the thread number, you can post that thread number in here with something like

"I moved this thread to the VBA forum Thread123-4556789. Please respond there."

In your new thread you can post something like
"This thread was originally posted in the Access forum Thread705-...."
 
This thread has been move to the VBA forum.
thread707-1593407


Thanks

John Fuhrman
faq329-6766
faq329-7301
thread329-1334328
thread329-1424438
thread705-1592825
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top