0
Outlook에서 메일 그룹을 사용하여 양식 편지를 만들 수 없으므로 (이 목록을 선택할 수 없음) 연락처의 연락처 정보를 읽고 싶습니다. 배포 목록에 있습니다.Outlook 연락처 정보 배포 목록에서 연락처
API에 따르면 ContactItem을 가져 오거나 속성 접근 자로 속성을 읽을 수 있어야합니다. 둘 다 작동하지 않습니다. 쉬운 방법은 연락처 이름 (AddressEntry에서 읽을 수 있음) 만 읽고 Outlook 주소록에서 검색하는 것입니다. 그러나 이것은 성 가시고 오류가 발생할 수 있다고 생각합니다.
아래 테스트 코드를 참조하십시오. GetContact() 및 GetProperty()는 작동하지 않습니다.
이름이나 회사 주소 등 연락처 세부 정보를 얻는 다른 방법이 있습니까?
Option Explicit
Sub test()
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection
Dim myOlDistList As Outlook.DistListItem
Dim nrListItems As Integer
Dim myRecipient As Outlook.Recipient
Dim myAddressEntry As Outlook.AddressEntry
Dim myContactItem As Outlook.ContactItem
Dim myPropertyAccessor As Outlook.propertyAccessor
Dim givenName As String
Set myOlExp = Application.ActiveExplorer
Set myOlSel = myOlExp.Selection
Set myOlDistList = myOlSel.Item(1)
For nrListItems = 1 To myOlDistList.MemberCount
Set myRecipient = myOlDistList.GetMember(nrListItems)
Set myAddressEntry = myRecipient.AddressEntry
' does not work
Set myContactItem = myAddressEntry.GetContact
Set myPropertyAccessor = myAddressEntry.propertyAccessor
' does also not work
givenName = myPropertyAccessor.GetProperty("urn:schemas:contacts:givenName")
Next nrListItems
End Sub