Cannot locate Microsoft.Office.Interop.Outlook Reference - c#

I have been tasked to convert an Outlook Distribution list to a CSV file.
I have seen some examples online but I can’t find the COM reference.
Question:
Do I need to have Office installed to find the reference?
Does a subscription to Office 365 work as well?
I’m developing this project with VS 2022, and .NET 6
Thank you!

First of all, there are several ways to get get distribution list members. If you deal with Exchange profiles only you may consider using EWS, see Expanding a distribution list by using the EWS Managed API 2.0 for more information.
Another possible option is Graph API. Distribution lists are actually represented by the group entity in Microsoft Graph, so in your case you should be able to use the id returned from your people search in the following to get the group/DLs members
GET https://graph.microsoft.com/v1.0/groups/{id}/members
You could just search for your DL by filtering on the group entity:
GET https://graph.microsoft.com/v1.0/groups?$filter=displayName eq 'DL_NAME'
The people API is really about people that you communicate with most often - and it includes users, groups and contacts.
Both EWS and Graph API don't require installing anything on the end-user machine and can be used from the server-side or service software.
The last option is automating Outlook. In that case you need to install the desktop editions of Outlook to get a COM server registered for the application. As soon as COM server is registered you can add an Outlook COM reference.
Does a subscription to Office 365 work as well?
Yes, if it allows installing Outlook on your machine.

Related

How to go about it: sync/export data for Accounts from Microsoft Dynamics 365 CRM and show it in a 3rd party web app? Using WS and ASP.NET MVC/C#

I'm trying to get data from Microsoft Dynamics 365 CRM, specifically the Accounts and their data to show it in my own web app that I will build using ASP.NET MVC and C#.
How would I go about doing this so that my web app will instantly be updated when the data in CRM changes? I find it difficult enough navigating through the Dynamics platform already, thanks Microsoft.
The app would work like this:
When run, the app would get the initial data, and establish a real-time connection with WS to the CRM to get further new data/changes.
the app will display this data in a table.
When a change is detected, the web app should update without refreshing the page.
individual table rows will be colored according to number of contacts and if they lack any contact data.
I've started researching webhooks with MS CRM, but it seems Visual Basic is crapping out on me a lot and I cant get the tools to work properly . I think that I have to establish a connection somehow with WebSocket to the CRM, I just don't know which technologies to use and what plugins there are, seeing I'm new to ASP.NET MVC and C#.
Anyway, I just don't know where to start. Could someone send me in the right direction? I would greatly appreciate it!
You can access the data inside a Dynamics 365 / Power Apps instance (also known as Dynamics CRM or Dynamics 365 CE) using the APIs provided by the system.
You can leverage these APIs using the SDK provided by Microsoft (this one https://www.nuget.org/packages/Microsoft.CrmSdk.XrmTooling.CoreAssembly/ or this one in preview for .NET Core https://www.nuget.org/packages/Microsoft.PowerPlatform.Dataverse.Client/) or by calling the API directly inside the language of your choice.
Usually you need to deal with CRUD events, and the APIs can do that. In your question you mention "the web app should update without refreshing the page" so you will need to take a look at webhooks (here a doc page https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/use-webhooks) handle them in your application and see if they fit your requirements.

Allow user to send email Dot net

I am working on an application which requires a feature to allow user to send emails . I looked for SMTP but it requires password ( and i guess it should be used for organization level emails with one time configuration) . I also looked for MAPi using this repo but i could not make it work
https://github.com/PandaWood/Simple-MAPI.NET
So is there a way to achieve this , specifically opening default mail application of the user with attachment.
Thanks
Here is what MS states for the Simple MAPI:
The use of Simple MAPI is discouraged. It may be altered or unavailable in subsequent versions of Windows.
Simple MAPI is a set of functions and related data structures you can use to add messaging functionality to Windows-based applications written in C, C++, or Visual Basic. You can use pinvoke to call Simple MAPI functions from your application, see Writing cross platform P/Invoke code for more information.
Also you may consider using the mailto protocol or just automating Outlook (if it is installed on the system). That's the most easiest way.
If you deal with Exchange profiles you may also consider using EWS or Graph API. Read more about EWS in the Explore the EWS Managed API, EWS, and web services in Exchange article.

Upload document to Microsoft Dynamics CRM integrated with Sharepoint

I need to be able to upload a document created totally outside Sharepoint and CRM into the CRM document management system on the associated Sharepoint site. By the way it is Microsoft Dynamics CRM online. I have searched high and low, asked Sharepoint experts, called Microsoft Support but cannot find a solution. The document is created dynamically, probably in some sort of batch process, so this needs to be handled programmatically. The application is written in C# and I want, after creating the document, to find the relevant Sharepoint folder within the CRM system, which will be under one of the account entities, and upload it there. The one solution I did come across is this:
Add document sharepoint using web service Microsoft Dynamics CRM
Which seems promising but I can't get it to work. Has anyone ever done anything like this before?

Outlook.com REST API - Backwards compatability with LiveID Live SDK

I'm using the new unified Outlook Rest API and it works great for Office 365 accounts but Outlook.com accounts often throw MailboxNotEnabledForRESTAPI exception. I understand there is transition going on now that will move all existing accounts to the new API. Is there an example on how to implement a backwards compatible call to the older LiveId/Windows Live SDK? The application registration portal has a check box under advanced called "Live SDK Support". What does this mean and how do I write fall back logic when a user uses my service and they have not been transitioned? Any help would be appreciated as we are trying to ship this service in the next day or so.

How to retrieve all Office 365 users in the same domain with C#?

Microsoft provides a PowerShell command Get-Msoluser to retrieve all office 365 users. I don't want my application tied to PowerShell, so I want to write a C# function to do the work, unfortunately, there's not much information on this topic.
I looked in the Office 365 APIs Preview documentation, no such functionality; also I looked into the SharePoint Client Object Model, no such thing either.
Can this be done without PowerShell? Is there a SDK can do this?
Yes, you can use the Azure AD Graph Client Library. There are also a couple of samples in that link that will show you how to retrieve your user(s).
This library is available as a nuget package.
https://www.nuget.org/packages/Microsoft.Azure.ActiveDirectory.GraphClient/1.0.2

Categories