Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

SharePoint OpenDocuments.EditDocument Method not working on Dynamics CRM 2016

$
0
0

Hello all,

I am using OpenDocuments.EditDocument Method to open word document from Microsoft CRM 2016 using aspx c# web applicatoin on button action but it is not open when I call this function in Microsoft CRM 2016.

public static void OpenDocumentForEdit(string docUrl)
    {
        Type t = null;
        // get the correct version specific version...
        t = Type.GetTypeFromProgID("SharePoint.OpenDocuments.1");
        if (t == null)
        {
            t = Type.GetTypeFromProgID("SharePoint.OpenDocuments.2");
        }
        if (t == null)
        {
            t = Type.GetTypeFromProgID("SharePoint.OpenDocuments.3");
        }
        if (t == null)
        {
            System.Diagnostics.Process.Start(docUrl);    // best we can do, will open read-only
            return;
        }

        Object o = Activator.CreateInstance(t);
        object[] openParms = { docUrl, string.Empty };

        t.InvokeMember("EditDocument",
            System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance,
            null, o, openParms);
    }


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>