Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jun 22nd, 2007, 9:55 AM   #1
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Question Getting Alias from Address Book ???

Hello All,

I have a small app that sends an email to a person and then looks up their manager in Address Book and sends them an email..unfortunetly there are duplicate names in address book and emails are the same, thus I need to use Alias (or so i've been told)...i cant seem to access the alias field though..

My Code:

 Private Sub doEmail(ByVal Qrecords() As String, ByVal Nrecords() As String, ByVal recordSize As Integer)

        Dim i As Integer 'loop counter
        Dim OutlookApp As New Microsoft.Office.Interop.Outlook.Application 'application
        Dim msg As Microsoft.Office.Interop.Outlook._MailItem 'Mail item  

        Dim attached As Microsoft.Office.Interop.Outlook.Attachments '= msg.Attachments
        Dim attached2 As Microsoft.Office.Interop.Outlook.Attachment

        Dim oNameSpace As Microsoft.Office.Interop.Outlook.NameSpace
        oNameSpace = OutlookApp.GetNamespace("MAPI")

        Dim oAddressLists As Microsoft.Office.Interop.Outlook.AddressLists
        Dim oAddressList As Microsoft.Office.Interop.Outlook.AddressList
        oAddressLists = oNameSpace.AddressLists
        oAddressList = oAddressLists.Item("All Users")

        For i = 0 To UBound(Nrecords)
            msg = OutlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
            attached = msg.Attachments
            msg.To = Nrecords(i)

            If managers.Checked Then
                If Not oAddressList.AddressEntries.Item(Nrecords(i)).Manager Is Nothing Then
                    msg.CC = oAddressList.AddressEntries.Item(Nrecords(i)).Manager.ID

                End If
            End If


            msg.Subject = "Pls review within within 30 days"

            msg.Body = "Your ID: " & Qrecords(i) & " currently has access to." & systemName.Text & Environment.NewLine & Environment.NewLine & " If you still require this access, please respond to " & replyToTxt.Text & " by: " & replyDate.Text & " with the document attached." & vbCrLf & " Please note, if we do not receive a reply by " & replyDate.Text & ", access will be disabled." & vbCrLf & vbCrLf & " Thank you " & vbCrLf & " Please not this is an automated message, please do not reply to sender."
            If Len(attachedFile) > 0 Then
                attached2 = attached.Add(attachedFile)
            End If

            msg.Send()

        Next
    End Sub

Any Thoughts ... Many thanks in advance
paulchwd is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SquirrelMail Address book to mySQL Lich PHP 0 Jun 30th, 2006 1:19 PM
OnlineTextEditor.Com! Sane Show Off Your Open Source Projects 43 Jun 16th, 2006 8:55 AM
Pointers in C (Part II) Stack Overflow C 2 Apr 29th, 2005 10:39 AM
Pointers in C (Part I) Stack Overflow C 4 Apr 28th, 2005 7:03 PM
C++ Address Book [NEED HELP] prognewb C++ 5 Mar 16th, 2005 3:25 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC