Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
364to368
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
364to368
364to368
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Mailkontakt auslesen

Mailkontakt auslesen
15.01.2004 14:48:30
Marcl
Guten Tag zusammen,
kann man mit Makro auch Mailadressen aus einer Kontaktliste in Outlook auslesen?
Gruß
Marcl

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Mailkontakt auslesen
15.01.2004 16:26:55
q
Hallo,
hier ist ein Beispiel. Man muss nur die Referentz an MS Outlook Object Lib. setzen - Menu "Tools/References". Gruss q

Option Explicit
Public

Sub OutlAddressList()
Dim lRow As Long
Dim OutlApp As Outlook.Application
Dim NameSp As NameSpace
Dim AdrLsts As AddressLists
Dim AdrLst As AddressList ' Returns the AddressEntries collection
Dim AdrEntrs As AddressEntries
Dim AdrEntr As AddressEntry
On Error Resume Next
Err.Clear
Set OutlApp = New Outlook.Application
Set NameSp = OutlApp.GetNamespace("MAPI")
' The AddressLists collection represents the root of the address book
' hierarchy for the current session. A particular AddressList object
' represents one of the available address books.
Set AdrLsts = NameSp.AddressLists
lRow = 0
For Each AdrLst In AdrLsts
Set AdrEntrs = AdrLst.AddressEntries
For Each AdrEntr In AdrEntrs
lRow = lRow + 1
Cells(lRow, 1).Value = AdrLst.Name
Cells(lRow, 2).Value = AdrEntr.Address
Next AdrEntr
Next AdrLst
' OutlApp.Quit
Set OutlApp = Nothing
If (Err.Number <> 0) Then MsgBox "Error Nr. : " & Err.Number
End Sub

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige