XSLTransforms Members (Word)

GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

A collection of XSLTransform objects that represent all of the Extensible Stylesheet Language Transformations (XSLTs) for a specific XML namespace.

Use the Add method to add an individual XSLTransform object to the collection of XSLTs for a schema. The following example adds simplesample.xslt to the XSLTs for the SimpleSample schema.

Sub AddXSLT() 
 Dim objSchema As XMLNamespace 
 Dim objTransform As XSLTransform 
 
 Set objSchema = Application.XMLNamespaces("SimpleSample") 
 Set objTransform = objSchema.XSLTransforms _ 
 .Add("c:\schemas\simplesample.xslt") 
 
End Sub

Use the Item method to return a single XSLTransform object. The following example deletes the first XSLT in the collection of XSLTs for the SimpleSample schema.

Sub DeleteTransform() 
 Dim objXSLT As XSLTransform 
 Dim intResponse As Integer 
 
 Set objXSLT = Application.XMLNamespaces("SimpleSample") _ 
 .XSLTransforms.Item(1) 
 
 intResponse = MsgBox("Are you sure you want to delete the " _ 
 & objXSLT.Alias & " XSL transform?", vbYesNo) 
 
 If intResponse = vbYes Then objXSLT.Delete 
 
End Sub
Note Note

The SimpleSample schema is included in the Smart Document Software Development Kit (SDK). For more information, refer to the Smart Document SDK on the Microsoft Developer Network (MSDN) Web site.

Show: