Document.TransformDocument method (Word)

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

Syntax

expression. TransformDocument( _Path_ , _DataOnly_ )

expression Required. A variable that represents a Document object.

Parameters

Name Required/Optional Data type Description
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")

See also

Document Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.