Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web (intranet) page email link to custom outlook form

Status
Not open for further replies.

PMSLIC

IS-IT--Management
Mar 7, 2002
46
US
Is this possible?
 
I know this is an OLD message but it was never answered.
So here is a method to do this.
NOTE: This method relies on the client having Outlook installed on their device as it uses it to establish the connection to the exchange server and the custom form.
The client will need to have rights to that form as well.

Code:
<head> 
<script language="JavaScript" type="text/JavaScript"> 
<!-- Enable Stealth Mode 
   // This script uses a button or text link to open a MAPI connection to the clients
   // Outlook application and launches the custom form defined by the button/link
   // and passes custom values into the form.
 
   // 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.Subject = "This is the subject"

      // These pass values into custom form fields
      // by first defining the field name under userproperties then assigning a value.
      mailItem.userproperties("MyFieldName1") = "Some information"
      mailItem.userproperties("MyFieldName2") = "Some information"
      mailItem.userproperties("MyFieldName3") = "Some information"
 
      mailItem.Display(0)
      } 
      catch(e) 
      { 
      // act on any error that you get 
      } 
      } 
      // Disable Stealth Mode --> 
</script> 
</head> 
<body> 
<form> 
To use form buttons:<br> 
<!-- NOTE: To get the name of the form click Tools, Forms, Choose A Form and then browse to the form you want to open.  Click on it once and it will display the name on the Message Class line of that window. -->
<input type=button value="Form A" NAME="OutlookOpen1" OnClick="OpenOutlookDoc('IPM.Appointment.Calendar Entry')"><br><br> 
To use text links:<br> 
<a href=javascript:void(0) onClick="OpenOutlookDoc('IPM.Appointment.Calendar Entry')">Form A</a><br><br> 
<!-- change the information between the single quotes to match your custom forms class Name like IPM.Note.CustomForm - you can have different links to different forms, provided you specify a different class Name for each link //--> 
</form> 
</body> 
</html>

Paranoid? ME?? WHO WANTS TO KNOW????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top