R
Reinfried
Where can I get the Linked account-value (not the Field CompanyName) in a
BusinessContact with VBA? Is this the "ParentDisplayName" anh how can I get
it?
Sub SelectBusinessContact()
Dim olApp As Outlook.Application
Dim objNS As Outlook.Namespace
Dim bcmRootFolder As Outlook.Folder
Dim olFolders As Outlook.Folders
Dim bcmContactsFldr As Outlook.Folder
Dim existContact As Outlook.ContactItem
Set olApp = CreateObject("Outlook.Application")
Set objNS = olApp.GetNamespace("MAPI")
Set olFolders = objNS.Session.Folders
Set bcmRootFolder = olFolders("Business Contact Manager")
Set bcmContactsFldr = bcmRootFolder.Folders("Geschäftskontakte")
Dim strLastName
Dim strCompanyName
strLastName = "Gates"
strCompanyName = "Microsoft"
Set existContact = bcmContactsFldr.Items.Find("[LastName] = " & "'" &
strLastName & "'" & " AND [CompanyName] = '" & strCompanyName & "'" & "")
If Not TypeName(existContact) = "Nothing" Then
MsgBox existContact.FullName & vbCrLf & existContact.BusinessAddress _
& vbCrLf & "Tel.Nr.Büro: " & existContact.BusinessTelephoneNumber _
& vbCrLf & "Fax.Nr.Büro: " & existContact.BusinessFaxNumber _
& vbCrLf & "Mobil: " & existContact.MobileTelephoneNumber _
& vbCrLf & "Firma: " & existContact.CompanyName
Else
MsgBox ("Could not find the Business Contact")
End If
Set existContact = Nothing
Set bcmContactsFldr = Nothing
Set bcmRootFolder = Nothing
Set olFolders = Nothing
Set objNS = Nothing
Set olApp = Nothing
End Sub
Many Thanks
Reinfried
BusinessContact with VBA? Is this the "ParentDisplayName" anh how can I get
it?
Sub SelectBusinessContact()
Dim olApp As Outlook.Application
Dim objNS As Outlook.Namespace
Dim bcmRootFolder As Outlook.Folder
Dim olFolders As Outlook.Folders
Dim bcmContactsFldr As Outlook.Folder
Dim existContact As Outlook.ContactItem
Set olApp = CreateObject("Outlook.Application")
Set objNS = olApp.GetNamespace("MAPI")
Set olFolders = objNS.Session.Folders
Set bcmRootFolder = olFolders("Business Contact Manager")
Set bcmContactsFldr = bcmRootFolder.Folders("Geschäftskontakte")
Dim strLastName
Dim strCompanyName
strLastName = "Gates"
strCompanyName = "Microsoft"
Set existContact = bcmContactsFldr.Items.Find("[LastName] = " & "'" &
strLastName & "'" & " AND [CompanyName] = '" & strCompanyName & "'" & "")
If Not TypeName(existContact) = "Nothing" Then
MsgBox existContact.FullName & vbCrLf & existContact.BusinessAddress _
& vbCrLf & "Tel.Nr.Büro: " & existContact.BusinessTelephoneNumber _
& vbCrLf & "Fax.Nr.Büro: " & existContact.BusinessFaxNumber _
& vbCrLf & "Mobil: " & existContact.MobileTelephoneNumber _
& vbCrLf & "Firma: " & existContact.CompanyName
Else
MsgBox ("Could not find the Business Contact")
End If
Set existContact = Nothing
Set bcmContactsFldr = Nothing
Set bcmRootFolder = Nothing
Set olFolders = Nothing
Set objNS = Nothing
Set olApp = Nothing
End Sub
Many Thanks
Reinfried