我正在使用以下代码打开全局地址窗口,但自从更新到 Office 365 后,它不再打开。我在网上做了很多搜索,但找不到遇到同样问题的人。有人可以帮忙吗?
代码:
Dim cdoSession, cdoAddressBook, olkRecipients, objAE
On Error Resume Next
Set cdoSession = CreateObject("MAPI.Session")
cdoSession.Logon "", "", False, False
Set olkRecipients = cdoSession.AddressBook(, "Global Address List", 0, False)
For Each objAE In olkRecipients
'MsgBox objAE.Name
TextBox1.Value = objAE.Name
Next
Set olkRecipients = Nothing
cdoSession.Logoff
Set cdoSession = Nothing