|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 Cellfarmer 于 2014-10-9 13:57 编辑
Sub getAddress_For_2010()
On Error Resume Next
Dim olapp As Outlook.Application
Dim objAddressEntries As Outlook.AddressEntries
Dim objAddressEntry As Outlook.AddressEntry
Set olapp = New Outlook.Application
Set objAddressEntries = olapp.Session.GetGlobalAddressList.AddressEntries
Dim i As Long
Sheet3.Select
j = 2
For i = 1 To objAddressEntries.Count - 1
Set objAddressEntry = objAddressEntries.GetNext
If objAddressEntry.AddressEntryUserType = olExchangeUserAddressEntry Then
Cells(j, 3).Value = objAddressEntry.getcontact.ManagerName
Cells(j, 4).Value = objAddressEntry.getcontact.CompanyName
Cells(j, 5).Value = objAddressEntry.getcontact.Gender
Cells(j, 6).Value = objAddressEntry.getcontact.Birthday
j = j + 1
End If
Next
End Sub
在输入代码时能提示出来.GetContact,但输完后变成了getcontact了,这个方法在AddressEntry对象中也是存在的,为什么不能用呢?
|
|