There may be a scenario when working in Dynamics CRM where you want to open an email activity in Outlook, as Outlook provides a richer set of formatting and usability options. Yet, if the email record is created (perhaps automatically) within CRM, you’ll want it to stay in CRM. In addition, you’ll want an easy way to move it to Outlook and automatically populate the body, subject, and recipients, etc. with data from CRM email activity.


Good news! You can accomplish the this by creating a new JavaScript web resource in CRM which will grab each specific email field value, open a new Outlook email, and populate the fields in the Outlook email.

As a use case, you can add a custom ribbon button called “Send Email to Outlook” on the email activity form. The button will call a JavaScript function which would read the email fields from the current record and pass them along to the function below, which will then open a new Outlook email and populate the fields. You may, in addition, populate additional fields such as From, or BCC, or Priority or even add attachments.

function Email(To, Subject, Body) {
    try {
        var theApp = new ActiveXObject("Outlook.Application");
        var objNS = theApp.GetNameSpace('MAPI');

        // value 0 = MailItem
        var theMailItem = theApp.CreateItem(0)

        //Bind the variables with the email = To;
        theMailItem.Subject = Subject;

 // "Body";
        theMailItem.Body = Body;

        //Show the mail before sending for review purpose

        //You can directly use the theMailItem.send() function
        //if you do not want to preview the message first.
    catch (err) {

This solution provides an easy, quick, and efficient way to move the contents of a CRM email activity that is created in CRM to a more user-friendly environment in Outlook.

Note: To open email in Outlook, Outlook needs to be up and running.

Important: As this code utilizes the ActiveXObject, it will only work if using Internet Explorer.

Hope you find this useful. Happy CRM’ing!

Avatar for Joe D365

Joe D365

Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.