Document.SetCompatibilityMode Method
Sets the compatibility mode for the document. This method can be used only in Word 2010 projects.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)
Syntax
'Declaration
Sub SetCompatibilityMode ( _
Mode As Integer _
)
void SetCompatibilityMode(
int Mode
)
Parameters
- Mode
Type: System.Int32
One of the Microsoft.Office.Interop.Word.WdCompatibilityMode values that specifies the compatibility mode that Word 2010 uses when opening the document.
Exceptions
Exception | Condition |
---|---|
MissingMemberException | This method is used in a Word 2007 project. |
Remarks
When you open a document in Word 2010 that was created in a previous version of Word, Compatibility Mode is turned on. Compatibility Mode ensures that no new or enhanced features in Word 2010 are available while working with a document, so that people who edit the document using previous versions of Word will have full editing capabilities.
Note
This method appears in IntelliSense in Word 2007 projects that target the .NET Framework 4. However, this property cannot be used in Word 2007 projects.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.