[RESOLVED] javascript olMailItem
Hi everyone,
I need to convert the code below to javascript. I'm close except I have problems with the olMailItem part. See both sample below. Any help would be great. :D
thx
VB Code:
Sub btnEmail(subject, tofield, body)
Set myOlApp = CreateObject("Outlook.Application")
Set myOlExp = myOlApp.ActiveExplorer
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.Subject = subject
myItem.Body = body
myItem.To = tofield
myOLExp.Activate
MyItem.Display
End Sub
Code:
function btnEmailJava(subject, tofield, body)
{
var myOlApp = new ActiveXObject("Outlook.Application");
var myOlExp = myOlApp.ActiveExplorer;
var myItem = ??????;
myItem.Subject = subject;
myItem.Body = body;
myItem.To = tofield;
myOLExp.Activate;
MyItem.Display;
}
Re: javascript olMailItem
Re: javascript olMailItem
Quote:
Originally Posted by RobDog888
Did you try "Object"?
You are the man!!!! Thanks
Just rated you!
If anyone else reads this thread here is the working code.....
Code:
function btnEmailJava(subject, tofield, body)
{
var myOlApp = new ActiveXObject("Outlook.Application");
var myOlExp = myOlApp.ActiveExplorer;
var myItem = myOlApp.CreateItem(Object.olMailItem);
myItem.Subject = subject;
myItem.Body = body;
myItem.To = tofield;
myOlExp.Activate();
myItem.Display();
}