I am trying to attach a file to outlook Application using java script.Its working fine in IE 10 and above but not in any other browsers.
Here is my requirement.
For Document Library
a. When a user comes and click on ECB Menu of a file for a document Library.
b. I have given a custom ECB action. On click of which I want the document to be attached to outlook appilcation.
For Search
a. Similar functionality is required when a user comes and click on my custom link in search preview pane.
Below is my full code. On click of my custom link I am calling the below function.
function launchOutlook(itemUrl) {
var docUrl = location.protocol + '//' + location.host + itemUrl;
var objO = new ActiveXObject('Outlook.Application');
var objNS = objO.GetNameSpace('MAPI');
var mItm = objO.CreateItem(0);
mItm.Display();
mItm.Attachments.Add(docUrl);
mItm.GetInspector.WindowState = 2;
}
I am facing issue in below line of code.
var objO = new ActiveXObject('Outlook.Application');
The ActiveXObject works only with IE but it does not show any result with any other browser. Below is the link which I used.
I also searched on Internet and found the ActivexObject only works for IE and not for any other browser.
Please help!!
Any other solution to this will be appreciated.