XSLTransforms.Add Method

Word Developer Reference

Returns an XSLTransform object that represents an Extensible Stylesheet Language Transformation (XSLT) added to the collection of XSLTs for a specified schema.

Syntax

expression.Add(Location, Alias, InstallForAllUsers)

expression   Required. A variable that represents a XSLTransforms collection.

Parameters

Name Required/Optional Data Type Description
Location Required String The path and file name of the XSLT. This may be a local file path, a network path, or an Internet address.
Alias Optional String The name of the XSLT as it appears in the Schema Library.
InstallForAllUsers Optional Boolean True if all users that log on to a computer can access and use the new schema. The default is False.

Return Value
XSLTransform

Example

The following code adds a schema to the Schema Library and then adds an XSLT to the newly added schema.

Visual Basic for Applications
  Sub AddXSLT()
    Dim objSchema As XMLNamespace
    Dim objTransform As XSLTransform
    
    Set objSchema = Application.XMLNamespaces("SimpleSample")
    Set objTransform = objSchema.XSLTransforms _
        .Add("c:\schemas\simplesample.xsl")

End Sub

See Also