Compartir a través de


DocumentBase.Compatibility Property

Gets a value that indicates whether the specified compatibility option is enabled.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property Compatibility As Document_CompatibilityType
public Document_CompatibilityType Compatibility { get; }

Property Value

Type: Microsoft.Office.Tools.Word.Document_CompatibilityType
Returns Document_CompatibilityType.

Remarks

The Compatibility property is intended to be used with the following parameter.

Parameter

Description

Type

One of the WdCompatibility values that specifies the compatibility option to check for.

If you use the Compatibility property without specifying a parameter, it returns a Document_CompatibilityType object that is not intended to be used directly from your code.

Compatibility options affect how a document is displayed in Microsoft Office Word. Some of the WdCompatibility values might not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.

Examples

The following code example suppresses the space before a paragraph if the paragraph is located after a hard page break. To use this example, run it from the ThisDocument class in a document-level project.

Private Sub DocumentCompatibility()
    Me.Compatibility(Word.WdCompatibility.wdSuppressSpBfAfterPgBrk) = True 
End Sub
private void DocumentCompatibility()
{
    this.Compatibility[Word.WdCompatibility.wdSuppressSpBfAfterPgBrk] = true;
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace