Microsoft KB Archive/225210

= PRB: Outlook Form Code Not Added When Using HTML Form Converter =

Article ID: 225210

Article Last Modified on 3/15/2004

-

APPLIES TO


 * Microsoft Exchange Server 5.5 Service Pack 1
 * Microsoft Exchange Server 5.5 Service Pack 2
 * Microsoft Exchange Server 5.5 Service Pack 3
 * Microsoft Collaboration Data Objects 1.2
 * Microsoft Collaboration Data Objects 1.21
 * Microsoft Exchange Server 5.5 Standard Edition

-



This article was previously published under Q225210



SYMPTOMS
When you convert a Microsoft Outlook form to a Hypertext Markup Language (HTML) form using the HTML Form Converter, any code that was linked to buttons on the original Microsoft Outlook form will not be placed onto the converted active server pages (ASP) page for the HTML form. The code that was in the previous Microsoft Outlook form will be placed in the file Script.txt located in the same directory as the newly created ASP files.



STATUS
This behavior is by design.



MORE INFORMATION
The following steps demonstrate how to add code to a button that was created on the original Microsoft Outlook form:  Create a Microsoft Outlook form that has one command button on the form with the name of "cmdDisplay". Use the HTML forms converter to change the form to a HTML form. Go to the respective directory that the form is created in, as follows:

Drive\(Exchange Server Directory)\WEBDATA\USA\FORMS\IPM\NOTE\(Form Name)

Here is an example of the path that would be used:

C:\Exchsrvr\WebData\USA\FORMS\IPM\NOTE\Equipment_20Request

Where the actual name of the Microsoft Outlook form is Equipment Request.

  Open the ASP file that displays the main form. Search for the name of the button that is being modified. In the following example:

cmdDisplay_46_0_g is the converted name for the cmdDisplay button on the original Microsoft Outlook form.

The prior listed item pertains to a control. The name of the control is in the form named "a_b_c_d"   Where: a = control's Outlook name b, c, d = other info necessary to guarantee uniqueness  This is the same name that appears in the ToDo.txt.  Create a new function called "push_me" or whatever the name is in the OnClick= statement for the HTML button. The function can be added at the beginning of the current ASP that the generated HTML resides in.  Cut and paste the respective code from the ToDo.txt file that corresponds to this button. There are a few things that you need to be aware of when adding this code: <ul> This is client-side script, so to keep cross-browser compatiblity, you should use Javascript.</li> The script is also running in an ASP, so you may not have the Microsoft Outlook client installed, so you should rewrite any code that uses the Microsoft Outlook Object Model to use CDO instead.</li></ul>

For example, the following code corresponds to the prior HTML button and launches a msgbox upon execution (This code was placed at the begining of the HTML section of the ASP): <SCRIPT LANGUAGE="JavaScript"> var rtn=false function push_me {   var msg1="This is a sample message from the HTML form." alert(msg1) return true }  </SCRIPT> </li> Save the ASP file and launch the form using your browser. The button on the form should display a message box.</li></ol>

<div class="references_section">