Jump to content

Outlook contact collection


Dampe
 Share

Recommended Posts

Had to write a VBS for Tafe to show my understanding of Outlook objects..

Converted it to AutoIt, thought it may come in usefull.

Example:

#include <array.au3>

$t = _CollectContacts()
_ArrayDisplay($t)

Func _CollectContacts()
    Local Const $olFolderContacts = 10
    Local $rContacts[1]
    Local $rCount = 1

    $oOutlook = ObjCreate("Outlook.Application")
    $objNamespace = $oOutlook.GetNamespace("MAPI")

    $colContacts = $objNamespace.GetDefaultFolder($olFolderContacts).Items
    
    For $objContact In $colContacts
        If $objContact.Email1Address <> "" Then
            ConsoleWrite($objContact.Email1Address & @CRLF)
            ReDim $rContacts[$rCount + 1]
            $rContacts[$rCount] = $objContact.Email1Address
            $rCount += 1
        EndIf
    Next
    Return $rContacts
EndFunc  ;==>_CollectContacts
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...