omega
omega

Reputation: 43833

How to use Application dialogs in c#?

Im trying to follow this Microsoft tutorial to display the names of a distribution list in c#

https://learn.microsoft.com/en-us/office/client-developer/outlook/pia/how-to-get-members-of-an-exchange-distribution-list

This example prompts the user to select an Exchange distribution list from the Select Names dialog box and expands the distribution list to display its members.

except when I get an error here

enter image description here

I have this in a console app project. How can I fix this?

Upvotes: 0

Views: 89

Answers (1)

Iliass Akkara
Iliass Akkara

Reputation: 671

You can fix this by creating an Application instance, as per suggestion made by the prompt in your screenshot. Like so:

Application app = new Application();
Outlook.SelectNamesDialog snd = app.Session.GetSelectNamesDialog();

Sources:

  1. How to invoke a method with (Outlook.Application application) as parameter in C#?

Upvotes: 1

Related Questions