Andrew Truckle
Andrew Truckle

Reputation: 19087

Using Microsoft Outlook API with C# to list calendars and add events

I have found some Microsoft Resources about how to use the REST API to connect to an Outlook account. The sample tutorial they provided got me to create a WPF project and register an app with the Outlook Developer centre.

So I have done all of that and can connect to Outlook. It shows the content screen where the user must allow access. All good.

But I don't want to use WPF. Ideally I want to write a C# .NET DLL component what with communicate with the Outlook API so that I can specifically:

I understand that I need to use the Microsoft.Graph library but I can't find out how to use this with C# .NET.

I am familiar with the Google Calendar API and have written a VB. NET command line utility that does the same things. So I was hoping to do things similarly.

The WPF tutorial stops at the "connect" stage so I am at a loss as to how to proceed. And the other example is here:

https://learn.microsoft.com/en-us/outlook/rest/dotnet-tutorial

That shows you how to write a utility with ASP.NET MVC Web app to get Outlook mail, calendar, and contacts. But again, I am confused as to how to do what I want with C#.NET DLL.

If it is possible to using the Microsoft.Graph library from C# DLL to list the calendars etc. I would appreciate guidance.

If there is a more direct resource I should point this question to then I would be more than happy to do so.

Thank you.

PS. Please note that I am referring to the online Outlook system and not the Microsoft Outlook on a user PC.

Upvotes: 1

Views: 19706

Answers (2)

Jair Villarreal
Jair Villarreal

Reputation: 91

This sample demonstrates how to use the Microsoft Graph .NET SDK to access data in Office 365 from ASP.NET Core apps.

git code

Upvotes: 0

Marc LaFleur
Marc LaFleur

Reputation: 33094

There are a number of C# examples using the Microsoft Graph .NET SDK available on GitHub. There is a Console App example included in that list: ConsoleApp-DeltaQuery-DotNet-Sample.

Upvotes: 2

Related Questions