I am creating a wpf application to send outlook appointment. In this application I am opening outlook select name dialog box to select recipients of the appointment. Following is my code:
Outlook.SelectNamesDialog selectNameDialog =
outlookApp.Session.GetSelectNamesDialog();
selectNameDialog.SetDefaultDisplayMode(
Outlook.OlDefaultSelectNamesDisplayMode.olDefaultMeeting);
foreach (var recipient in recipientsList)
{
if (string.IsNullOrEmpty(recipient))
continue;
Outlook.Recipient confRoom =
selectNameDialog.Recipients.Add(recipient);
// Explicitly specify Recipient.Type.
confRoom.Type = (int)Outlook.OlMeetingRecipientType.olRequired;
}
selectNameDialog.Recipients.ResolveAll();
selectNameDialog.Display();
My problem is that when I open select name dialog it works fine if outlook is not running. But if outlook is running and I open this dialog on click from my application, it opens in back of my application and on top of outlook window. I need to show it on top of my application even if outlook is running. Any help will be highly appreciated to bring this dialog in front of all. Thanks in advance.