ListComposeForms Method (RenderingApplication Object)

ListComposeForms Method (RenderingApplication Object)

Important  The Collaboration Data Objects (CDO) 1.2.1 Rendering objects are not installed by or supported for use with Exchange Server 2003 or later.

The ListComposeForms method returns an array of compose form strings.

Syntax

strArrayFormList = objRendApp.ListComposeForms(bstrLinkPattern, varLanguageDirectory)

strArrayFormList

On successful return, contains a string array of designated compose form strings.

objRendApp

Required. The RenderingApplication object.

bstrLinkPattern

Required. String. The pattern string used to generate the designated form strings.

varLanguageDirectory

Optional. String.

Remarks

The ListComposeForms method can be used to support launching custom forms from Web clients.

The bstrLinkPattern parameter can include any or all of the following substitution tokens:

Substitution token

Attribute substituted for token

%class%

The message class

%classpath%

The partial URL path for the form

%formname%

The form's name from FORM.INI

Each returned string is a copy of the bstrLinkPattern string with any substitution tokens replaced with the values appropriate for the corresponding form.

For example, Microsoft® Outlook® Web Access might set bstrLinkPattern to

  rgForms = objRA.ListComposeForms("<A HREF='JavaScript:openNewWindow
            (""/Exchange/forms/%classpath%/frmroot.asp?command=new"",
            ""New message"", 640, 500)'>%formname%</A>")
 

In order for a form to be reflected in the returned list, there must be a file named FORM.INI in the form directory, as well as frmroot.asp. FORM.INI may have the following contents:

    [Description]     DisplayName=<form name>     Hidden=0/1

If FORM.INI files have been added to or deleted from the form directory since you called ListComposeForms, you can refresh the list of designated compose forms by setting the FormsRoot property to its current value.

Example

This script demonstrates the ListComposeForms method as it might be used from Microsoft® Outlook® Web Access:

<HTML>
<!--
 This script tests RenderingApplication.ListComposeForms
 First it writes out a table listing all the %tokens% for each form.
 Next it writes out a table using an Outlook Web Access link pattern;
      these links should bring up a form when followed.
-->
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Developer Studio">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Test RenderingApplication.ListComposeForms</TITLE>
<script language="Javascript">

function openNewWindow(fileName,windowName,theWidth,theHeight) {
  if (windowName == "newMessageWindow")
  {
    //generate random window ID
     windowName = new String(Math.round(Math.random() * 100000));
  }
  window.open(fileName,windowName,"toolbar=0,location=0,directories=0,
  status=1,menubar=1,scrollbars=1,resizable=1,width="+theWidth+",
  height="+theHeight)
}
</script>
</HEAD>
<BODY>
<%
set objRA = Application("RenderApplication")
szCommand = Request.QueryString("command")
%>
<% if szCommand = "refresh" then %>
<%
Err.Clear
objRA.FormsRoot = Server.MapPath("/Exchange") & "\usa"
if err <> 0 then
Response.Write err.number & " : " & err.description & "<br>"
else
Response.Write "Forms list successfully refreshed." & "<br>"
end if
%>
<center>
<P>Click <A HREF=f.asp>here</A> to view the forms list.
</center>
<% else %>
<%
rgNames = objRA.ListComposeForms("%formname%")
rgPaths = objRA.ListComposeForms("%classpath%")
rgClasses = objRA.ListComposeForms("%class%")
rgForms = objRA.ListComposeForms("<A HREF='JavaScript:openNewWindow
          (""/Exchange/forms/%classpath%/frmroot.asp?command=new"",
          ""New message"", 640, 500)'>%formname%</A>")
%>
<% if isempty(rgnames) then %>
<P>
<% else %>
<P>This table enumerates all the variables accessible through ListComposeForms.
<table border=1 columns=3 width=100%>
<tr><td><b>Name</b></td><td><b>Path</b></td><td><b>Class</b></td></tr>
<%
for i = 1 to UBound(rgNames)
  Response.Write "<tr>"
  Response.Write "<td>" & rgNames(i) & "</td><td>" & rgPaths(i) &
    "</td><td>" & rgClasses(i) & "</td>"
  Response.Write "</tr>"
next
%>
</table>




<% end if %>
<% if isempty(rgForms) then %>
<P>There are no composable forms on this server.
<% else %>
<P>This table contains working links to forms.
<center>
<table border=1 width=50%>
<%
  for each szForm in rgForms
    Response.Write "<tr><td align=center>"
    Response.Write szForm
    Response.Write "</td></tr>"
  next
%>
</table>




</center>
<% end if %>
<center>
<P>Click <A HREF=f.asp?command=refresh>here</A> to refresh the forms list.
</center>
<% end if %>
</BODY>
</HTML>
 

See Also

Concepts

RenderingApplication Object