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);
}