TransformDocument Method

Applies the specified Extensible Stylesheet Language Transformation (XSLT) file to the specified document and replaces the document with the results.

expression.TransformDocument(Path, DataOnly)

expression Required. An expression that returns a Document object.

Path    Required String. The path for the XSLT to use.

DataOnly    Optional Boolean. True applies the transformation only to the data in the document, excluding Microsoft Word XML. False applies the transform to the entire document, including Word XML. Default value is True.

Example

The following example transforms the active document using the specified XSLT file.

ActiveDocument.TransformDocument _
    ("c:\schemas\simplesample.xslt")

Applies to | Document Object