How to get Designation of the recepient from Outlook

Hi,
Can anyone say How to get Designation of the recipient from Outlook through UIPath.

@Nuthan

Tell me one thing. Generally, how you will get to know about designation from outlook.

This is how it is got through Macro. I would like to know how we get it using UIPath

Set myRecipient = myItem.Recipients.Add(“Email address”)
Debug.Print ("Job Title: " & myRecipient.AddressEntry.GetExchangeUser.JobTitle)

Hi did you find any way to resolve this ?

I have used following VBA code in Invoke VBA activity.

Public Function Get_JobTitle(Recipient As String) As String
Dim obApp As Object
Dim NewMail As Object

Set obApp = CreateObject(“Outlook.Application”)
Set NewMail = obApp.CreateItem(olMailItem)
With NewMail
.Subject = Date & " Test Email"
.To = Recipient
End With

Get_JobTitle = NewMail.Recipients.Item(1).AddressEntry.GetExchangeUser.JobTitle
NewMail.Delete
Set obApp = Nothing
Set NewMail = Nothing

End Function

And this got me the Job title detail.

If someone is new to uipath, below is how you Invoke VBA.

a C# version of this

try{
	Microsoft.Office.Interop.Outlook.Application oapp = new Microsoft.Office.Interop.Outlook.Application();
	Microsoft.Office.Interop.Outlook.MailItem newMail = (Microsoft.Office.Interop.Outlook.MailItem)oapp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
	newMail.To = "shan.km@xxxxxx.com";
	String Designation = newMail.Recipients[1].AddressEntry.GetExchangeUser().JobTitle;
	Console.WriteLine("Designation:"+Designation);
}
catch(System.Exception ex){
	Console.WriteLine(ex.ToString());
}

make sure to import Microsoft.Office.Interop.Outlook