Is it possible to create an Outlook object?
mtaberna opened this issue · comments
Manuel Taberna commented
I am trying to write something similar to the following code:
var outlook = new ActiveXObject("Outlook.Application");
message = outlook.CreateItem(0);
message.Subject = 'Double-Header Today';
message.Body = 'This is the message body.';
message.Save();
message.Display();
And I am getting an error when trying to create an Outlook object ( Error: CreateInstance: Outlook.Application error in server execution
)
Does activex support Outlook object?
Yuri Dursin commented
I don`t know.
I don`t use Outlook.
But should work the same as cscript.exe.
2018-04-07 19:56 GMT+03:00 Manuel Taberna <notifications@github.com>:
… I am trying to write something similar to the following code:
var outlook = new ActiveXObject("Outlook.Application");
message = outlook.CreateItem(0);
message.Subject = 'Double-Header Today';
message.Body = 'This is the message body.';
message.Save();
message.Display();
And I am getting an error when trying to create an Outlook object (Error:
CreateInstance: Outlook.Application error in server execution)
Does activex support Outlook object?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#26>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjGNXN7DGGuOmCzTXXRHxuKazBmiXYvks5tmO_TgaJpZM4TLKTN>
.
Manuel Taberna commented
It seems Outlook instance is possible to initiate via ActiveX if:
a) Outlook is running with superuser permissions
b) Outlook is not running at all
There might be some issues with x86 architecture and processes, I have no idea
somanuell commented
The outlook ActiveX works relatively well with node-activex. At least sending a mail form the default account is a 7 liners. Bellow code works identically in cscript.exe and in node.exe
if ( typeof module !== 'undefined' ) module.exports = require('winax/activex');
function Log( aString ) {
if ( typeof WScript !== 'undefined' ) {
WScript.Echo( aString );
} else {
console.log( aString );
}
return;
}
Log( 'Starting...' );
var oApp = new ActiveXObject("Outlook.Application");
var oMail = oApp.CreateItem(0);
oMail.Recipients.Add('someone@somesite.com');
oMail.Subject = 'Test Mail via ActiveX';
oMail.Send();
Log('Sent!');