CSDN首创.使用VB读OutLook地址本中的人和组:)

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

Dim OL As New outlook.Application
Dim OLNameS As outlook.NameSpace
Dim OLFolder As outlook.MAPIFolder
'OlContItem 用于接收单个连系人信息
Dim OLContItem As outlook.ContactItem
'OLDistListItem 用于接收组信息
Dim OLDistListItem As DistListItem
Dim i As Integer

Set OLNameS = OL.GetNamespace("MAPI")
Set OLFolder = OLNameS.GetDefaultFolder(olFolderContacts)
'Set sf = OLFolder.Items.Item(10)
For i = 1 To OLFolder.Items.Count
    If TypeName(OLFolder.Items.Item(i)) = "DistListItem" Then
        Set OLDistListItem = OLFolder.Items.Item(i)
        Debug.Print OLDistListItem.Subject
    Else
        Set OLContItem = OLFolder.Items.Item(i)
    '显示联系人信息
        Debug.Print OLContItem.FullName & "    " & OLContItem.MobileTelephoneNumber
    End If

Next

'OLContItem.Close olDiscard
'OLDistListItem.Close olDiscard
OL.Quit
Set OLFolder = Nothing
Set OL = Nothing

'关闭MAPI对话
OL.Quit

本文关键:CSDN首创.使用VB读OutLook地址本中的人和组:)
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top