problem in opening the forms in browser

M

Mohan

hello sir,
Please check the code down below.

<html>
<head>
<script language="JavaScript" type="text/JavaScript">
<!-- Enable Stealth Mode
// Variable Definitions
var nameSpace = null;
var mailFolder = null;
var mailItem = null;
var tempDoc = null;
var outlookApp = null;
function OpenOutlookDoc(whatform)
{
try
{

outlookApp = new ActiveXObject("Outlook.Application");
nameSpace = outlookApp.getNameSpace("MAPI");
mailFolder = nameSpace.getDefaultFolder(6);
mailItem = mailFolder.Items.add(whatform);
mailItem.Display(0)
}
catch(e)
{
// act on any error that you get
}
}
// Disable Stealth Mode -->
</script>
</head>
<body>
<form>
To use form buttons:<br>
<input type=button value="Form A" NAME="OutlookOpen1"
OnClick="OpenOutlookDoc('IPM.Note.leave request')"><br><br>
<!--
-->
</form>
</body>
</html>

If i save the above piece of code in a .htm file and execute it, i am
getting the "leave request" form properly loaded through the browser, but if
i save this page in a Web server(IIS) and if i try to access this page, the
form is not getting loaded in my machine. Both the Server(Exchange Server
2000 + IIS is installed) and the Client has outlook2000 installed. What
could be the problem? When i try to debugg the code, it get executes till
before the line "outlookApp = new ActiveXObject("Outlook.Application");, i
feel the problem is the ActiveX obj creation. What could be the reason? Is
it due to any security constraints? Please mail me.
"
 
S

Sue Mosher [MVP-Outlook]

Javascript is not my forte, but maybe you need to include
value="RunAtClient" in the parameters for the OutlookOpen1 button.

You would also want to put the site in the Trusted Sites list for the users.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top