Logo
English Russian German French Spanish Italian
contact usprivacy
   Support Forums
chart
• Adjust flexgrid cell
• Animation
• Centering form text
• Coffee machine
• Creating fileshares
• Creating shortcuts
• Custom buttons
• Directory browser
• Disable mouse events
• File search by ext
• File transfer
• File watcher
• Formatting flexgrid
• Get Content Type
• Get HTML source
• Get modem port
• HTTP proxy
• ipconfig
• Large file split/merge
• MAPI
• MCI Sound Player
• Menu with images
• MP3 normalizer
• Net Send
• Netstat 2000
• No duplicate entries
• Outlook Address Book
• Set font color
• Shapes
• SOAP test
• Text-to-image
• Text file viewer
• Text find/replace
• UPS component
• View NT groups
• Word template
• Writing DNS control
    • Using DNS control
• Writing SMTP control
    • Sending email
    • Mailing list
• Writing WhoIs control
    • Using WhoIs control
• View HTML source
VB projects - Using Outlook Address Book

Description: Using Outlook Address book for sending e-mails
Minimum requirements: vb, Outlook 98
Download: source code
Project: Standard EXE
Controls: lvw (ListView)
Code:
Dim olApp As Outlook.Application
Dim olNS As Outlook.NameSpace
Dim olAL As Outlook.AddressList
Dim olAE As Outlook.AddressEntry
Dim olMail As Outlook.MailItem

Private Sub Form_Load()
    Set olApp = New Outlook.Application
    Set olNS = olApp.GetNamespace("MAPI")
    For Each olAL In olNS.AddressLists
        For Each olAE In olAL.AddressEntries
            lvw.ListItems.Add , , olAE.Name
            lvw.ListItems(lvw.ListItems.Count).SubItems(1) = olAE.Address
            lvw.ListItems(lvw.ListItems.Count).SubItems(2) = olAE.ID
            lvw.ListItems(lvw.ListItems.Count).Tag = olAE.ID
        Next
    Next
End Sub

Private Sub Form_Unload(Cancel As Integer)
    olApp.Quit
    Set olApp = Nothing
End Sub

Private Sub lvw_DblClick()
    Set olMail = olApp.CreateItem(olMailItem)
    olMail.Recipients.Add lvw.SelectedItem.Text
    olMail.Subject = "Test"
    olMail.Body = "Test"
    olMail.Send
End Sub

Copyright © 1996-2009 OstroSoft. All rights reserved. info@ostrosoft.com