OpenXMLDocuments.CustomizeTemplate2 Method

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Opens the specified XML document or form template for customization within its associated application based on the specified instance of Internet Explorer.

expression.CustomizeTemplate2(pdisp, bstrSolutionLocation)



An expression that returns an OpenXMLDocuments Control object.


An Object representing a pointer to the Internet Explorer instance that is calling the CustomizeTemplate2 method. Using a null value for this argument results in the method being executed on the primary Internet Explorer thread. As an alternative, you can use the CustomizeTemplate method if you do not need to pass an object with this argument.


A string that contains the URL of the location of the document or form template to open for customization.

Return Value

true if the XML document or form template successfully opens; otherwise false.


The following example opens an XML document or form template for customization, whose location is specified by the value for the strTempLoc variable that is passed to the CustomizeTemplate2 method. The example assumes the existence of a form named frmCustomizeDoc that has one input box named TempLocation.

<script language="JavaScript">
function customizeDocument()
   // Create an instance of the OpenXMLDocuments object.
   xmlDocObject = new ActiveXObject("SharePoint.OpenXMLDocuments.1");

   // If the OpenXMLDocuments object was successfully created,
   // get the template location from the form's input box.
   if (xmlDocObject)
      var strTempLoc = document.frmCustomizeDoc.TempLocation.value;

      // Open the XML document or form template for customization.
      xmlDocObject.CustomizeTemplate2(window, strTempLoc);

See Also


OpenXMLDocuments Control

OpenXMLDocuments Members