Compartilhar via


Document.TransformDocument Method

Word Developer Reference

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.

Visual Basic for Applications
  ActiveDocument.TransformDocument _
    ("c:\schemas\simplesample.xslt")

See Also