How to Set Word Compatibility Options via VBA
In Word, you can use compatibility options to change the way Word handles the layout of a document. Instead of turning on and off compatibility options manually via the user interface in Word, you can handle the settings via VBA (macros). This requires that you know the name (or number) to use in the VBA code to set a specific option.
This article helps you find the names to use in VBA macros to set any compatibility option in Word. You will also find macros ready for use, including code for setting all compatibility options in different versions of Word. In addition, you will find VBA macros that show how to change the Compatibility Mode of a Word document.
The article covers all the following Word versions: Word 2003, 2007, 2010, 2013, 2016, 2019, 2021, and Word for Microsoft 365. See How to find out what version of Word you have, if needed.
For details about how to access the compatibility options manually via the user interface in Word, see my article Word Layout Options & Compatibility Options. That article also includes descriptions of the options and a list showing the names of all compatibility options in English and Danish side by side.
For information about Compatibility Mode in Word, see my article Word Compatibility Mode – What Is It?.
This article was first published March 5, 2020.
List of all 70 Word compatibility option names and the related VBA names
The WdCompatibility Enumeration includes constant names and values you can use to set the individual compatibility options via VBA in Word. For example, all compatibility options in the active document can be set via VBA by calling ActiveDocument.Compatibility with the appropriate WdCompatibility constant.
The list below shows the English compatibility option names (column 2) together with the related WdCompatibility Enumeration values (column 3) and WdCompatibility Enumeration names (column 4).
The numbers in the first column are only added for easier reference. Note that the numbers correspond to the numbers used in the lists in my article Word Layout Options & Compatibility Options. This means that you can quickly find the same option in the different lists.
In cases where the same option has been renamed between Word versions, the old name is shown in parentheses below the new name, incl. information about to which Word version(s) the old name applies.
Important differences between Word 2007 and other Word versions when setting some compatibility options via VBA
For unknown reasons, some compatibility options behave differently in Word 2007 than in other Word versions when setting the options via VBA. It seems to be a bug in Word 2007. The following applies:
- In Word 2007, you must set any compatibility option to TRUE to turn it ON. Correspondingly, you must set any compatibility option to FALSE to turn it OFF. This seems logical at first glance. However, it is not. If you note the names of the VBA members of the WdCompatibility Enumeration listed below, you will see that some names in VBA are opposite to the names in the user interface. For example, if the user interface name says "Do…", the corresponding WdCompatibility Enumeration constant says "Don't…".
- In all other version of Word than Word 2007, some compatibility options must be set to FALSE to be turned ON and TRUE to be turned OFF.
These differences in behavior of some compatibility options mean that you need to check any code for setting compatibility options to make sure the TRUE/FALSE settings are correct for the version of Word in use. If the same VBA code is to be used both in Word 2007 and other versions of Word and if you need to set any of the compatibility options that differ, your code must check for the Word version and handle the settings depending on whether it is Word 2007 or another Word version. See VBA the example below.
In the macros available in this article, I have set the TRUE/FALSE values correctly for the version(s) of Word each of the macros is created for.
In the list below, I have added a note below the options that must be FALSE to be turned ON and TRUE to be turned OFF in all versions except Word 2007.
Note that the list below does not show to which version(s) of Word each compatibility applies. To go to a page with an extended list that shows both the information below plus information about which Word version(s) each of the compatibility option applies to, click the button below.
No. | Compatibility option names | VBA | VBA |
1 | Add space for underlines | 21 | wdNoSpaceForUL NOTE: False = ON, True = OFF (except Word 2007) |
2 | Adjust line height to grid height in the table | 36 | wdDontAdjustLineHeightInTable NOTE: False = ON, True = OFF (except Word 2007) |
3 | Align table rows independently | 39 | wdAlignTablesRowByRow |
4 | Allow hyphenation between pages or columns | 71 | wdAllowHyphenationAtTrackBottom |
5 | Allow space between paragraphs of the same style in a table | 54 | wdAllowSpaceOfSameStyleInTable |
6 | Allow table rows to lay out apart | 41 | wdLayoutTableRowsApart |
7 | Allow tables to extend into margins | 50 | wdGrowAutofit |
8 | Auto space the way Word 95 does (Word 2003: Auto space like Word 95) | 38 | wdAutospaceLikeWW7 |
9 | Balance SBCS characters and DBCS characters | 16 | wdDontBalanceSingleByteDoubleByteWidth NOTE: False = ON, True = OFF (except Word 2007) |
10 | Combine table borders the way Word 5.x for the Macintosh does | 9 | wdOrigWordTableRules |
11 | Convert backslash characters into yen signs | 13 | wdLeaveBackslashAlone NOTE: False = ON, True = OFF (except Word 2007) |
12 | Disable OpenType Font Formatting Features | 66 | wdDisableOTKerning |
13 | Do full justification the way WordPerfect 6.x for Windows does | 31 | wdWPJustification |
14 | Don’t add automatic tab stop for hanging indent | 1 | wdNoTabHangIndent |
15 | Don’t add extra space for raised/lowered characters | 2 | wdNoSpaceRaiseLower |
16 | Don’t add leading (extra space) between rows of text | 20 | wdNoLeading |
17 | Don’t allow hanging punctuation with character grid | 47 | wdDontWrapTextWithPunctuation |
18 | Don’t autofit tables next to wrapped objects | 56 | wdDontAutofitConstrainedTables |
19 | Don’t balance columns at the start of Continuous sections | 5 | wdNoColumnBalance |
20 | Don’t blank the area behind metafile pictures | 10 | wdTransparentMetafiles |
21 | Don’t break constrained tables forced onto the page | 62 | wdDontBreakConstrainedForcedTables |
22 | Don’t break wrapped tables across pages | 43 | wdDontBreakWrappedTables |
23 | Don't center "exact line height" lines | 28 | wdExactOnTop |
24 | Don't expand character spaces on a line that ends with SHIFT+RETURN | 14 | wdExpandShiftReturn NOTE: False = ON, True = OFF (except Word 2007) |
25 | Don’t snap text to grid inside table with inline objects | 44 | wdDontSnapTextToGridInTableWithObjects |
26 | Don’t use Asian rules for line breaks with character grid | 48 | wdDontUseAsianBreakRulesInGrid |
27 | Don’t use hanging indent as tab stop for bullets and numbering | 52 | wdDontUseIndentAsNumberingTabStop |
28 | Don't use HTML paragraph auto spacing | 35 | wdDontUseHTMLParagraphAutoSpacing |
29 | Don’t use proportional width for Korean characters | 59 | wdHangulWidthLikeWW11 |
30 | Don’t vertically align inside of textboxes | 63 | wdDontVertAlignInTextbox |
31 | Don’t vertically align table cells containing shapes | 61 | wdDontVertAlignCellWithShape |
32 | Draw underline on trailing spaces | 15 | wdDontULTrailSpace NOTE: False = ON, True = OFF (except Word 2007) |
33 | Expand/condense by whole number of points | 18 | wdSpacingInWholePoints |
34 | Forget last tab alignment | 37 | wdForgetLastTabAlignment |
35 | Lay out AutoShapes the way Word 97 does | 33 | wdShapeLayoutLikeWW8 |
36 | Lay out footnotes the way Word 6.x/95/97 does | 34 | wdFootnoteLayoutLikeWW8 |
37 | Lay out tables with raw width | 40 | wdLayoutRawTableWidth |
38 | Print body text before header/footer | 19 | wdPrintBodyTextBeforeHeader |
39 | Print colors as black on noncolor printers | 3 | wdPrintColBlack |
40 | Select entire field with first or last character | 45 | wdSelectFieldWithFirstOrLastCharacter |
41 | Set the width of a space like WordPerfect 5.x | 30 | wdWPSpaceWidth |
42 | Show hard page or column breaks in frames | 11 | wdShowBreaksInFrames |
43 | Split apart page break and paragraph mark | 60 | wdSplitPgBreakAndParaMark |
44 | Substitute fonts based on font size | 25 | wdSubFontBySize |
45 | Suppress extra line spacing at bottom of page | 29 | wdSuppressBottomSpacing |
46 | Suppress extra line spacing at top of page | 8 | wdSuppressTopSpacing |
47 | Suppress extra line spacing at top of page the way Word 5.x for the Macintosh does (Word 2003: Suppress extra line spacing at top of page like Word 5.x for the Mac) | 17 | wdSuppressTopSpacingMac5 |
48 | Suppress extra line spacing the way WordPerfect 5.x does (Word 2003: Suppress extra line spacing like WordPerfect 5.x) | 23 | wdNoExtraLineSpacing |
49 | Suppress Space Before after a hard page or column break | 7 | wdSuppressSpBfAfterPgBrk |
50 | Swap inside and outside mirror indents and relative positioning | 67 | wdFlipMirrorIndents |
51 | Swap left and right borders on odd facing pages | 12 | wdSwapBordersFacingPages |
52 | Treat \* as ** in mail merge data sources | 6 | wdConvMailMergeEsc |
53 | Truncate font height | 24 | wdTruncateFontHeight |
54 | Underline tab character in numbered lists | 58 | wdUnderlineTabInNumList |
55 | Use cached paragraph information for column balancing | 65 | wdCachedColBalance |
56 | Use larger small caps the way Word 5.x for the Macintosh does | 22 | wdMWSmallCaps |
57 | Use line-breaking rules | 46 | wdApplyBreakingRules |
58 | Use Normal style for bulleted and numbered lists | 51 | wdUseNormalStyleForList |
59 | Use printer metrics to lay out document | 26 | wdUsePrinterMetrics |
60 | Use Word 2002 table style rules | 49 | wdUseWord2002TableStyleRules |
61 | Use Word 2002-2007 style evaluation rules for font size and paragraph justification in tables | 68 | wdDontOverrideTableStyleFontSzAndJustification |
62 | Use Word 2003 hanging-punctuation rules | 53 | wdFELineBreak11 |
63 | Use Word 2003 indent rules for text next to wrapped objects | 55 | wdWW11IndentRules |
64 | Use Word 2003 kerning pair rules | 64 | wdWord11KerningPairs |
65 | Use Word 2013 rules for hyphenation between pages and columns | 72 | wdUseWord2013TrackBottomHyphenation |
66 | Use Word 2003 table autofit rules | 57 | wdAutofitLikeWW11 |
67 | Use Word 6.x/95 border rules | 27 | wdWW6BorderRules |
68 | Use Word 97 line-breaking rules for Asian text | 42 | wdUseWord97LineBreakingRules |
69 | Wrap lines the way Word 6.0 does (Word 2003: Lines wrap like Word 6.0) | 32 | wdLineWrapLikeWord6 |
70 | Wrap trailing spaces to next line | 4 | wdWrapTrailSpaces |
VBA macros – detect or change the compatibility mode of a document
If a Word document shows the text Compatibility Mode in the title bar, it means that the document was created or last saved in an earlier version of Word than the version you are using.
- You can use VBA to find out which version of Word a document is compatible with.
- You can use VBA to change the compatibility mode of a document.
See the VBA examples below.
The WdCompatibilityMode enumeration
The WdCompatibilityMode enumeration specifies the compatibility mode that Word uses when opening a document.
In the VBA code, you can use either the name or the value.
- The code is easier to read for others (and for yourself later) if you use the names.
- On the other hand, the code will fail with run-time error 5843 if you use a name from a newer version of Word than the version in which the code is running.
See the rules described below for more details.
Name | Value | Description – Long, read-only |
wdWord2003 | 11 | Mode that is most compatible with Word 2003. If opened in Word 2007 or newer version, features new to Word compared to Word 2003 are disabled. |
wdWord2007 | 12 | Mode that is most compatible with Word 2007. If opened in Word 2010 or newer version, features new to Word compared to Word 2007 are disabled. |
wdWord2010 | 14 | Mode that is most compatible with Word 2010. If opened in Word 2013 or newer version, features new to Word compared to Word 2010 are disabled. |
wdWord2013 | 15 | Common mode for Word 2013, 2016, 2019, 2021, and 365. All features in the Word version in question are enabled. |
wdCurrent | 65535 | Compatibility mode equivalent to the current version of Word, i.e. the version in use when running the VBA code. |
RULE 1 no. 1– You can't set the compatibility mode to a version newer than the current Word version
You can't set the Compatibility Mode of a document to a version newer than the current Word version in which the VBA code is running.
If, for example, you are using Word 2010 and attempt to set the compatibility mode to wdWord2013, the macro will fail with run-time error 5843, "One of the values passed to this method or property is out range." (see the illustration below).
If you use the value instead (i.e. 15 instead of wdWord2013 in the example used here), no run-time error will occur but the code will do nothing!
RULE no. 2 – You can't set a compatibility option if that option is not available in the current compatibility mode
You can't set a compatibility option if that option is not available in the current Compatibility Mode. You will need to first change the Compatibility mode and then set the Compatibility option.
If, for example, you are using Word 2019 and attempt to set a compatibility option that is not found in Word 2019, the macro will fail with run-time error 6213, "One of the values passed to this method or property is out range for this file format." (see the illustration below).
VBA – Set the active document to be compatible with Word 2003
ActiveDocument.SetCompatibilityMode wdWord2003
In this example and the examples for other Word versions below, you may add the parameter name, Mode, if you want. The result is the same:
ActiveDocument.SetCompatibilityMode Mode:=wdWord2003
VBA – Set the active document to be compatible with Word 2007
ActiveDocument.SetCompatibilityMode wdWord2007
VBA – Set the active document to be compatible with Word 2010
ActiveDocument.SetCompatibilityMode wdWord2010
VBA – Set the active document to be compatible with Word 2013, 2016, 2019, 2021, 365
ActiveDocument.SetCompatibilityMode wdWord2013
VBA – Set the active document to be compatible with the current version of Word
The current Word version is the version in use when running the VBA code.
ActiveDocument.SetCompatibilityMode wdCurrent
VBA – Find out whether the active document is compatible with the current version of Word
Before running VBA code that only works with documents in a specific Compatibility Mode, you should add code to check the mode before running such code.
Each Word version has an Application.Version number. In Word 2013 and earlier versions, the Application.Version number match the WdCompatibilityMode enumeration value. However, Application.Version is in the format ##.0 (e.g. 11.0 for Word 2003, 14.0 for Word 2010). Therefore, the Val function is used in the VBA code below in order to compare the values of Application.Version and the WdCompatibilityMode enumeration value.
You will find an overview of Word version numbers in my wordaddins.com article here.
Since Word 2013 and newer versions share the same WdCompatibilityMode enumeration value, the VBA code can't just compare Val(Application.Version) with the WdCompatibilityMode enumeration value. Therefore, the example below operates on Word 2010 and earlier versus Word 2013 and newer versions.
The VBA code below can be used with Word 2003, 2007, 2010, 2013, 2016, 2019, 2021, and 365. The code sets blnIsCompatible to True if the active document is compatible with the current Word version and False if not. You can the use the result to determine what to do next.
In the VBA code below, 15 is used instead of wdWord2013 to prevent a run-time error in case the code is running in Word 2010 or earlier version.
Dim blnIsCompatible As Boolean
lngVersion = Val(Application.Version)
If lngVersion <= 14 Then
'Word 2010 and earlier
If lngVersion = ActiveDocument.CompatibilityMode Then
blnIsCompatible = True
Else
blnIsCompatible = False
End If
ElseIf lngVersion >= 15 Then
'Word 2013 and newer
If ActiveDocument.CompatibilityMode = 15 Then
blnIsCompatible = True
Else
blnIsCompatible = False
End If
End If
If blnIsCompatible = True Then
'Document IS compatible with current version of Word
'Add relevant code here
Else
'Document is NOT compatible with current version of Word
'Add relevant code here
End If
VBA – Find the actual compatibility mode of the active document
'lngCompMode will return one of the values 11, 12, 14, 15
lngCompMode = ActiveDocument.CompatibilityMode
VBA – Find out whether the active document is in a specific compatibility mode, e.g. Word 2010
In the example below, it is checked whether the active document is in Word 2010 compatibility mode. Replace wdWord2010 with another WdCompatibilityMode enumeration constant to check for another version.
If .CompatibilityMode = wdWord2010 Then
'Document IS compatible in Word 2010 compatibility mode
'Add relevant code here
Else
'Document is NOT in Word 2010 compatibility mode
'Add relevant code here
End If
End With
VBA – Change the Compatibility Mode and turn on a compatibility option available in the new mode
If you need to set a compatibility option that is not available in the actual Compatibility Mode of a document but in earlier Word version, you can get access to that compatibility option by changing the Compatibility Mode of the document.
Note that setting the Compatibility Mode to an earlier version of Word may influence other layout details too in addition to the one(s) you specifically want to change.
In the example below, the Compatibility Mode of the active document is set to Word 2010 and the compatibility option Select entire field with first or last character is turned on.
With ActiveDocument .SetCompatibilityMode wdWord2010 .Compatibility(wdSelectFieldWithFirstOrLastCharacter) = True End With
VBA – Set a compatibility option that acts differently in Word 2007 in code that is to be used in both Word 2007 and other Word versions
As described above, some compatibility options are to be set to True in Word 2007 and False in other Word versions (or vice versa) to obtain the same result.
If you are writing VBA code that is to be used both Word 2007 and other versions of Word, you need to take this into account.
The example below turns ON one of the compatibility options that behaves differently in Word 2007, wdExpandShiftReturn (option no. 24 in the lists). The code checks for the Word version in order to apply True or False as needed:
'Word 2007
ActiveDocument.Compatibility(wdExpandShiftReturn) = True
Else
'Other Word versions
ActiveDocument.Compatibility(wdExpandShiftReturn) = False
End If
VBA – set all compatibility options – Word 2003
Below, you will find two macros, each including code for setting all compatibility options in documents in Word 2003 format. MACRO 1 turns on all compatibility options in the active document. MACRO 2 turns off all compatibility options in the active document.
- Word 2003 includes 50 compatibility options. For each compatibility option, the macros below include a comment showing the related English (US) name used in the user interface of Word.
- You can adjust each individual setting in the macros as desired by changing True to False of vice versa.
MACRO 1 Word 2003 – turn ON all compatibility options
IMPORTANT: Note that some of the compatibility options must be set to False to be turned ON!
With ActiveDocument
'=========================
'Macro created 2020 by Lene Fredborg, DocTools - www.thedoctools.com
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
'=========================
'This macro can be used in documents in Word 2003 format
'THE MACRO TURNS ON ALL 50 WORD 2003 COMPATIBILITY OPTIONS
'IMPORTANT: SOME OPTIONS MUST BE SET TO FALSE TO BE TURNED ON
'=========================
'=========================
'Add space for underlines
'FALSE = TURNED ON!
.Compatibility(wdNoSpaceForUL) = False
'=========================
'Adjust line height to grid height in the table
'FALSE = TURNED ON!
.Compatibility(wdDontAdjustLineHeightInTable) = False
'=========================
'Align table rows independently
.Compatibility(wdAlignTablesRowByRow) = True
'Allow table rows to lay out apart
.Compatibility(wdLayoutTableRowsApart) = True
'Allow tables to extend into margins
.Compatibility(wdGrowAutofit) = True
'Auto space the way Word 95 does
.Compatibility(wdAutospaceLikeWW7) = True
'=========================
'Balance SBCS characters and DBCS characters
'FALSE = TURNED ON!
.Compatibility(wdDontBalanceSingleByteDoubleByteWidth) = False
'=========================
'Combine table borders the way Word 5.x for the Macintosh does
.Compatibility(wdOrigWordTableRules) = True
'=========================
'Convert backslash characters into yen signs
'FALSE = TURNED ON!
.Compatibility(wdLeaveBackslashAlone) = False
'=========================
'Do full justification the way WordPerfect 6.x for Windows does
.Compatibility(wdWPJustification) = True
'Don't add automatic tab stop for hanging indent
.Compatibility(wdNoTabHangIndent) = True
'Don't add extra space for raised/lowered characters
.Compatibility(wdNoSpaceRaiseLower) = True
'Don't add leading (extra space) between rows of text
.Compatibility(wdNoLeading) = True
'Don't allow hanging punctuation with character grid
.Compatibility(wdDontWrapTextWithPunctuation) = True
'Don't balance columns at the start of Continuous sections
.Compatibility(wdNoColumnBalance) = True
'Don't break wrapped tables across pages
.Compatibility(wdDontBreakWrappedTables) = True
'Don't blank the area behind metafile pictures
.Compatibility(wdTransparentMetafiles) = True
'Don't center "exact line height" lines
.Compatibility(wdExactOnTop) = True
'=========================
'Don't expand character spaces on a line that ends with SHIFT+RETURN
'FALSE = TURNED ON!
.Compatibility(wdExpandShiftReturn) = False
'=========================
'Don't snap text to grid inside table with inline objects
.Compatibility(wdDontSnapTextToGridInTableWithObjects) = True
'Don't use Asian rules for line breaks with character grid
.Compatibility(wdDontUseAsianBreakRulesInGrid) = True
'Don't use HTML paragraph auto spacing
.Compatibility(wdDontUseHTMLParagraphAutoSpacing) = True
'=========================
'Draw underline on trailing spaces
'FALSE = TURNED ON!
.Compatibility(wdDontULTrailSpace) = False
'=========================
'Expand/condense by whole number of points
.Compatibility(wdSpacingInWholePoints) = True
'Forget last tab alignment
.Compatibility(wdForgetLastTabAlignment) = True
'Lay out AutoShapes the way Word 97 does
.Compatibility(wdShapeLayoutLikeWW8) = True
'Lay out footnotes the way Word 6.x/95/97 does
.Compatibility(wdFootnoteLayoutLikeWW8) = True
'Lay out tables with raw width
.Compatibility(wdLayoutRawTableWidth) = True
'Print body text before header/footer
.Compatibility(wdPrintBodyTextBeforeHeader) = True
'Print colors as black on noncolor printers
.Compatibility(wdPrintColBlack) = True
'Select entire field with first or last character
.Compatibility(wdSelectFieldWithFirstOrLastCharacter) = True
'Set the width of a space like WordPerfect 5.x
.Compatibility(wdWPSpaceWidth) = True
'Show hard page or column breaks in frames
.Compatibility(wdShowBreaksInFrames) = True
'Substitute fonts based on font size
.Compatibility(wdSubFontBySize) = True
'Suppress extra line spacing at bottom of page
.Compatibility(wdSuppressBottomSpacing) = True
'Suppress extra line spacing at top of page
.Compatibility(wdSuppressTopSpacing) = True
'Suppress extra line spacing at top of page the way Word 5.x for the Macintosh does
.Compatibility(wdSuppressTopSpacingMac5) = True
'Suppress extra line spacing the way WordPerfect 5.x does
.Compatibility(wdNoExtraLineSpacing) = True
'Suppress Space Before after a hard page or column break
.Compatibility(wdSuppressSpBfAfterPgBrk) = True
'Swap left and right borders on odd facing pages
.Compatibility(wdSwapBordersFacingPages) = True
'Treat \* as ** in mail merge data sources
.Compatibility(wdConvMailMergeEsc) = True
'Truncate font height
.Compatibility(wdTruncateFontHeight) = True
'Use larger small caps the way Word 5.x for the Macintosh does
.Compatibility(wdMWSmallCaps) = True
'Use line-breaking rules
.Compatibility(wdApplyBreakingRules) = True
'Use printer metrics to lay out document
.Compatibility(wdUsePrinterMetrics) = True
'Use Word 2002 table style rules
.Compatibility(wdUseWord2002TableStyleRules) = True
'Use Word 6.x/95 border rules
.Compatibility(wdWW6BorderRules) = True
'Use Word 97 line-breaking rules for Asian text
.Compatibility(wdUseWord97LineBreakingRules) = True
'Wrap lines the way Word 6.0 does
.Compatibility(wdLineWrapLikeWord6) = True
'Wrap trailing spaces to next line
.Compatibility(wdWrapTrailSpaces) = True
End With
End Sub
MACRO 2 Word 2003 – turn OFF all compatibility options
IMPORTANT: Note that some of the compatibility options must be set to True to be turned OFF!
With ActiveDocument
'=========================
'Macro created 2020 by Lene Fredborg, DocTools - www.thedoctools.com
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
'=========================
'This macro can be used in documents in Word 2003 format
'THE MACRO TURNS OFF ALL 50 WORD 2003 COMPATIBILITY OPTIONS
'IMPORTANT: SOME OPTIONS MUST BE SET TO TRUE TO BE TURNED OFF
'=========================
'=========================
'Add space for underlines
'TRUE = TURNED OFF!
.Compatibility(wdNoSpaceForUL) = True
'=========================
'Adjust line height to grid height in the table
'TRUE = TURNED OFF!
.Compatibility(wdDontAdjustLineHeightInTable) = True
'=========================
'Align table rows independently
.Compatibility(wdAlignTablesRowByRow) = False
'Allow table rows to lay out apart
.Compatibility(wdLayoutTableRowsApart) = False
'Allow tables to extend into margins
.Compatibility(wdGrowAutofit) = False
'Auto space the way Word 95 does
.Compatibility(wdAutospaceLikeWW7) = False
'=========================
'Balance SBCS characters and DBCS characters
'TRUE = TURNED OFF!
.Compatibility(wdDontBalanceSingleByteDoubleByteWidth) = True
'=========================
'Combine table borders the way Word 5.x for the Macintosh does
.Compatibility(wdOrigWordTableRules) = False
'=========================
'Convert backslash characters into yen signs
'TRUE = TURNED OFF!
.Compatibility(wdLeaveBackslashAlone) = True
'=========================
'Do full justification the way WordPerfect 6.x for Windows does
.Compatibility(wdWPJustification) = False
'Don't add automatic tab stop for hanging indent
.Compatibility(wdNoTabHangIndent) = False
'Don't add extra space for raised/lowered characters
.Compatibility(wdNoSpaceRaiseLower) = False
'Don't add leading (extra space) between rows of text
.Compatibility(wdNoLeading) = False
'Don't allow hanging punctuation with character grid
.Compatibility(wdDontWrapTextWithPunctuation) = False
'Don't balance columns at the start of Continuous sections
.Compatibility(wdNoColumnBalance) = False
'Don't break wrapped tables across pages
.Compatibility(wdDontBreakWrappedTables) = False
'Don't blank the area behind metafile pictures
.Compatibility(wdTransparentMetafiles) = False
'Don't center "exact line height" lines
.Compatibility(wdExactOnTop) = False
'=========================
'Don't expand character spaces on a line that ends with SHIFT+RETURN
'TRUE = TURNED OFF!
.Compatibility(wdExpandShiftReturn) = True
'=========================
'Don't snap text to grid inside table with inline objects
.Compatibility(wdDontSnapTextToGridInTableWithObjects) = False
'Don't use Asian rules for line breaks with character grid
.Compatibility(wdDontUseAsianBreakRulesInGrid) = False
'Don't use HTML paragraph auto spacing
.Compatibility(wdDontUseHTMLParagraphAutoSpacing) = False
'=========================
'Draw underline on trailing spaces
'TRUE = TURNED OFF!
.Compatibility(wdDontULTrailSpace) = True
'=========================
'Expand/condense by whole number of points
.Compatibility(wdSpacingInWholePoints) = False
'Forget last tab alignment
.Compatibility(wdForgetLastTabAlignment) = False
'Lay out AutoShapes the way Word 97 does
.Compatibility(wdShapeLayoutLikeWW8) = False
'Lay out footnotes the way Word 6.x/95/97 does
.Compatibility(wdFootnoteLayoutLikeWW8) = False
'Lay out tables with raw width
.Compatibility(wdLayoutRawTableWidth) = False
'Print body text before header/footer
.Compatibility(wdPrintBodyTextBeforeHeader) = False
'Print colors as black on noncolor printers
.Compatibility(wdPrintColBlack) = False
'Select entire field with first or last character
.Compatibility(wdSelectFieldWithFirstOrLastCharacter) = False
'Set the width of a space like WordPerfect 5.x
.Compatibility(wdWPSpaceWidth) = False
'Show hard page or column breaks in frames
.Compatibility(wdShowBreaksInFrames) = False
'Substitute fonts based on font size
.Compatibility(wdSubFontBySize) = False
'Suppress extra line spacing at bottom of page
.Compatibility(wdSuppressBottomSpacing) = False
'Suppress extra line spacing at top of page
.Compatibility(wdSuppressTopSpacing) = False
'Suppress extra line spacing at top of page the way Word 5.x for the Macintosh does
.Compatibility(wdSuppressTopSpacingMac5) = False
'Suppress extra line spacing the way WordPerfect 5.x does
.Compatibility(wdNoExtraLineSpacing) = False
'Suppress Space Before after a hard page or column break
.Compatibility(wdSuppressSpBfAfterPgBrk) = False
'Swap left and right borders on odd facing pages
.Compatibility(wdSwapBordersFacingPages) = False
'Treat \* as ** in mail merge data sources
.Compatibility(wdConvMailMergeEsc) = False
'Truncate font height
.Compatibility(wdTruncateFontHeight) = False
'Use larger small caps the way Word 5.x for the Macintosh does
.Compatibility(wdMWSmallCaps) = False
'Use line-breaking rules
.Compatibility(wdApplyBreakingRules) = False
'Use printer metrics to lay out document
.Compatibility(wdUsePrinterMetrics) = False
'Use Word 2002 table style rules
.Compatibility(wdUseWord2002TableStyleRules) = False
'Use Word 6.x/95 border rules
.Compatibility(wdWW6BorderRules) = False
'Use Word 97 line-breaking rules for Asian text
.Compatibility(wdUseWord97LineBreakingRules) = False
'Wrap lines the way Word 6.0 does
.Compatibility(wdLineWrapLikeWord6) = False
'Wrap trailing spaces to next line
.Compatibility(wdWrapTrailSpaces) = False
End With
End Sub
VBA – set all compatibility options – Word 2007
Below, you will find two macros, each including code for setting all compatibility options in documents in Word 2007 format. MACRO 1 turns on all compatibility options in the active document. MACRO 2 turns off all compatibility options in the active document.
- Word 2007 includes 63 compatibility options. For each compatibility option, the macros below include a comment showing the related English (US) name used in the user interface of Word.
- You can adjust each individual setting in the macros as desired by changing True to False of vice versa.
MACRO 1 Word 2007 – turn ON all compatibility options
IMPORTANT: As opposed to all the other versions of Word, all compatibility options In Word 2007 must be set to True to be turned ON.
With ActiveDocument
'=========================
'Macro created 2020 by Lene Fredborg, DocTools - www.thedoctools.com
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
'=========================
'This macro can be used in documents in Word 2007 format
'THE MACRO TURNS ON ALL 63 WORD 2007 COMPATIBILITY OPTIONS
'ALL OPTIONS MUST BE SET TO TRUE TO BE TURNED ON
'=========================
'Add space for underlines
.Compatibility(wdNoSpaceForUL) = True
'Adjust line height to grid height in the table
.Compatibility(wdDontAdjustLineHeightInTable) = True
'Align table rows independently
.Compatibility(wdAlignTablesRowByRow) = True
'Allow space between paragraphs of the same style in a table
.Compatibility(wdAllowSpaceOfSameStyleInTable) = True
'Allow table rows to lay out apart
.Compatibility(wdLayoutTableRowsApart) = True
'Allow tables to extend into margins
.Compatibility(wdGrowAutofit) = True
'Auto space the way Word 95 does
.Compatibility(wdAutospaceLikeWW7) = True
'Balance SBCS characters and DBCS characters
.Compatibility(wdDontBalanceSingleByteDoubleByteWidth) = True
'Combine table borders the way Word 5.x for the Macintosh does
.Compatibility(wdOrigWordTableRules) = True
'Convert backslash characters into yen signs
.Compatibility(wdLeaveBackslashAlone) = True
'Do full justification the way WordPerfect 6.x for Windows does
.Compatibility(wdWPJustification) = True
'Don't add automatic tab stop for hanging indent
.Compatibility(wdNoTabHangIndent) = True
'Don't add extra space for raised/lowered characters
.Compatibility(wdNoSpaceRaiseLower) = True
'Don't add leading (extra space) between rows of text
.Compatibility(wdNoLeading) = True
'Don't allow hanging punctuation with character grid
.Compatibility(wdDontWrapTextWithPunctuation) = True
'Don't autofit tables next to wrapped objects
.Compatibility(wdDontAutofitConstrainedTables) = True
'Don't balance columns at the start of Continuous sections
.Compatibility(wdNoColumnBalance) = True
'Don't break constrained tables forced onto the page
.Compatibility(wdDontBreakConstrainedForcedTables) = True
'Don't break wrapped tables across pages
.Compatibility(wdDontBreakWrappedTables) = True
'Don't center "exact line height" lines
.Compatibility(wdExactOnTop) = True
'Don't expand character spaces on a line that ends with SHIFT+RETURN
.Compatibility(wdExpandShiftReturn) = True
'Don't snap text to grid inside table with inline objects
.Compatibility(wdDontSnapTextToGridInTableWithObjects) = True
'Don't use Asian rules for line breaks with character grid
.Compatibility(wdDontUseAsianBreakRulesInGrid) = True
'Don't use hanging indent as tab stop for bullets and numbering
.Compatibility(wdDontUseIndentAsNumberingTabStop) = True
'Don't use HTML paragraph auto spacing
.Compatibility(wdDontUseHTMLParagraphAutoSpacing) = True
'Don't use proportional width for Korean characters
.Compatibility(wdHangulWidthLikeWW11) = True
'Don't vertically align inside of textboxes
.Compatibility(wdDontVertAlignInTextbox) = True
'Don't vertically align table cells containing shapes
.Compatibility(wdDontVertAlignCellWithShape) = True
'Draw underline on trailing spaces
.Compatibility(wdDontULTrailSpace) = True
'Expand/condense by whole number of points
.Compatibility(wdSpacingInWholePoints) = True
'Forget last tab alignment
.Compatibility(wdForgetLastTabAlignment) = True
'Lay out AutoShapes the way Word 97 does
.Compatibility(wdShapeLayoutLikeWW8) = True
'Lay out footnotes the way Word 6.x/95/97 does
.Compatibility(wdFootnoteLayoutLikeWW8) = True
'Lay out tables with raw width
.Compatibility(wdLayoutRawTableWidth) = True
'Print body text before header/footer
.Compatibility(wdPrintBodyTextBeforeHeader) = True
'Print colors as black on noncolor printers
.Compatibility(wdPrintColBlack) = True
'Select entire field with first or last character
.Compatibility(wdSelectFieldWithFirstOrLastCharacter) = True
'Show hard page or column breaks in frames
.Compatibility(wdShowBreaksInFrames) = True
'Split apart page break and paragraph mark
.Compatibility(wdSplitPgBreakAndParaMark) = True
'Substitute fonts based on font size
.Compatibility(wdSubFontBySize) = True
'Suppress extra line spacing at bottom of page
.Compatibility(wdSuppressBottomSpacing) = True
'Suppress extra line spacing at top of page
.Compatibility(wdSuppressTopSpacing) = True
'Suppress extra line spacing at top of page the way Word 5.x for the Macintosh does
.Compatibility(wdSuppressTopSpacingMac5) = True
'Suppress extra line spacing the way WordPerfect 5.x does
.Compatibility(wdNoExtraLineSpacing) = True
'Suppress Space Before after a hard page or column break
.Compatibility(wdSuppressSpBfAfterPgBrk) = True
'Swap left and right borders on odd facing pages
.Compatibility(wdSwapBordersFacingPages) = True
'Treat \* as ** in mail merge data sources
.Compatibility(wdConvMailMergeEsc) = True
'Truncate font height
.Compatibility(wdTruncateFontHeight) = True
'Underline tab character in numbered lists
.Compatibility(wdUnderlineTabInNumList) = True
'Use cached paragraph information for column balancing
.Compatibility(wdCachedColBalance) = True
'Use larger small caps the way Word 5.x for the Macintosh does
.Compatibility(wdMWSmallCaps) = True
'Use line-breaking rules
.Compatibility(wdApplyBreakingRules) = True
'Use Normal style for bulleted and numbered lists
.Compatibility(wdUseNormalStyleForList) = True
'Use printer metrics to lay out document
.Compatibility(wdUsePrinterMetrics) = True
'Use Word 2002 table style rules
.Compatibility(wdUseWord2002TableStyleRules) = True
'Use Word 2003 indent rules for text next to wrapped objects
.Compatibility(wdWW11IndentRules) = True
'Use Word 2003 kerning pair rules
.Compatibility(wdWord11KerningPairs) = True
'Use Word 2003 hanging-punctuation rules
.Compatibility(wdFELineBreak11) = True
'Use Word 2003 table autofit rules
.Compatibility(wdAutofitLikeWW11) = True
'Use Word 6.x/95 border rules
.Compatibility(wdWW6BorderRules) = True
'Use Word 97 line-breaking rules for Asian text
.Compatibility(wdUseWord97LineBreakingRules) = True
'Wrap lines the way Word 6.0 does
.Compatibility(wdLineWrapLikeWord6) = True
'Wrap trailing spaces to next line
.Compatibility(wdWrapTrailSpaces) = True
End With
End Sub
MACRO 2 Word 2007 – turn OFF all compatibility options
IMPORTANT: As opposed to all the other versions of Word, all compatibility options In Word 2007 must be set to False to be turned OFF.
'26-Feb-2020
With ActiveDocument
'=========================
'Macro created 2020 by Lene Fredborg, DocTools - www.thedoctools.com
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
'=========================
'This macro can be used in documents in Word 2007 format
'THE MACRO TURNS OFF ALL 63 WORD 2007 COMPATIBILITY OPTIONS
'ALL OPTIONS MUST BE SET TO FALSE TO BE TURNED OFF
'=========================
'Add space for underlines
.Compatibility(wdNoSpaceForUL) = False
'Adjust line height to grid height in the table
.Compatibility(wdDontAdjustLineHeightInTable) = False
'Align table rows independently
.Compatibility(wdAlignTablesRowByRow) = False
'Allow space between paragraphs of the same style in a table
.Compatibility(wdAllowSpaceOfSameStyleInTable) = False
'Allow table rows to lay out apart
.Compatibility(wdLayoutTableRowsApart) = False
'Allow tables to extend into margins
.Compatibility(wdGrowAutofit) = False
'Auto space the way Word 95 does
.Compatibility(wdAutospaceLikeWW7) = False
'Balance SBCS characters and DBCS characters
.Compatibility(wdDontBalanceSingleByteDoubleByteWidth) = False
'Combine table borders the way Word 5.x for the Macintosh does
.Compatibility(wdOrigWordTableRules) = False
'Convert backslash characters into yen signs
.Compatibility(wdLeaveBackslashAlone) = False
'Do full justification the way WordPerfect 6.x for Windows does
.Compatibility(wdWPJustification) = False
'Don't add automatic tab stop for hanging indent
.Compatibility(wdNoTabHangIndent) = False
'Don't add extra space for raised/lowered characters
.Compatibility(wdNoSpaceRaiseLower) = False
'Don't add leading (extra space) between rows of text
.Compatibility(wdNoLeading) = False
'Don't allow hanging punctuation with character grid
.Compatibility(wdDontWrapTextWithPunctuation) = False
'Don't autofit tables next to wrapped objects
.Compatibility(wdDontAutofitConstrainedTables) = False
'Don't balance columns at the start of Continuous sections
.Compatibility(wdNoColumnBalance) = False
'Don't break constrained tables forced onto the page
.Compatibility(wdDontBreakConstrainedForcedTables) = False
'Don't break wrapped tables across pages
.Compatibility(wdDontBreakWrappedTables) = False
'Don't center "exact line height" lines
.Compatibility(wdExactOnTop) = False
'Don't expand character spaces on a line that ends with SHIFT+RETURN
.Compatibility(wdExpandShiftReturn) = False
'Don't snap text to grid inside table with inline objects
.Compatibility(wdDontSnapTextToGridInTableWithObjects) = False
'Don't use Asian rules for line breaks with character grid
.Compatibility(wdDontUseAsianBreakRulesInGrid) = False
'Don't use hanging indent as tab stop for bullets and numbering
.Compatibility(wdDontUseIndentAsNumberingTabStop) = False
'Don't use HTML paragraph auto spacing
.Compatibility(wdDontUseHTMLParagraphAutoSpacing) = False
'Don't use proportional width for Korean characters
.Compatibility(wdHangulWidthLikeWW11) = False
'Don't vertically align inside of textboxes
.Compatibility(wdDontVertAlignInTextbox) = False
'Don't vertically align table cells containing shapes
.Compatibility(wdDontVertAlignCellWithShape) = False
'Draw underline on trailing spaces
.Compatibility(wdDontULTrailSpace) = False
'Expand/condense by whole number of points
.Compatibility(wdSpacingInWholePoints) = False
'Forget last tab alignment
.Compatibility(wdForgetLastTabAlignment) = False
'Lay out AutoShapes the way Word 97 does
.Compatibility(wdShapeLayoutLikeWW8) = False
'Lay out footnotes the way Word 6.x/95/97 does
.Compatibility(wdFootnoteLayoutLikeWW8) = False
'Lay out tables with raw width
.Compatibility(wdLayoutRawTableWidth) = False
'Print body text before header/footer
.Compatibility(wdPrintBodyTextBeforeHeader) = False
'Print colors as black on noncolor printers
.Compatibility(wdPrintColBlack) = False
'Select entire field with first or last character
.Compatibility(wdSelectFieldWithFirstOrLastCharacter) = False
'Show hard page or column breaks in frames
.Compatibility(wdShowBreaksInFrames) = False
'Split apart page break and paragraph mark
.Compatibility(wdSplitPgBreakAndParaMark) = False
'Substitute fonts based on font size
.Compatibility(wdSubFontBySize) = False
'Suppress extra line spacing at bottom of page
.Compatibility(wdSuppressBottomSpacing) = False
'Suppress extra line spacing at top of page
.Compatibility(wdSuppressTopSpacing) = False
'Suppress extra line spacing at top of page the way Word 5.x for the Macintosh does
.Compatibility(wdSuppressTopSpacingMac5) = False
'Suppress extra line spacing the way WordPerfect 5.x does
.Compatibility(wdNoExtraLineSpacing) = False
'Suppress Space Before after a hard page or column break
.Compatibility(wdSuppressSpBfAfterPgBrk) = False
'Swap left and right borders on odd facing pages
.Compatibility(wdSwapBordersFacingPages) = False
'Treat \* as ** in mail merge data sources
.Compatibility(wdConvMailMergeEsc) = False
'Truncate font height
.Compatibility(wdTruncateFontHeight) = False
'Underline tab character in numbered lists
.Compatibility(wdUnderlineTabInNumList) = False
'Use cached paragraph information for column balancing
.Compatibility(wdCachedColBalance) = False
'Use larger small caps the way Word 5.x for the Macintosh does
.Compatibility(wdMWSmallCaps) = False
'Use line-breaking rules
.Compatibility(wdApplyBreakingRules) = False
'Use Normal style for bulleted and numbered lists
.Compatibility(wdUseNormalStyleForList) = False
'Use printer metrics to lay out document
.Compatibility(wdUsePrinterMetrics) = False
'Use Word 2002 table style rules
.Compatibility(wdUseWord2002TableStyleRules) = False
'Use Word 2003 indent rules for text next to wrapped objects
.Compatibility(wdWW11IndentRules) = False
'Use Word 2003 kerning pair rules
.Compatibility(wdWord11KerningPairs) = False
'Use Word 2003 hanging-punctuation rules
.Compatibility(wdFELineBreak11) = False
'Use Word 2003 table autofit rules
.Compatibility(wdAutofitLikeWW11) = False
'Use Word 6.x/95 border rules
.Compatibility(wdWW6BorderRules) = False
'Use Word 97 line-breaking rules for Asian text
.Compatibility(wdUseWord97LineBreakingRules) = False
'Wrap lines the way Word 6.0 does
.Compatibility(wdLineWrapLikeWord6) = False
'Wrap trailing spaces to next line
.Compatibility(wdWrapTrailSpaces) = False
End With
End Sub
VBA – set all compatibility options – Word 2010
Below, you will find two macros, each including code for setting all compatibility options in documents in Word 2010 format. MACRO 1 turns on all compatibility options in the active document. MACRO 2 turns off all compatibility options in the active document.
- Word 2010 includes 66 compatibility options. For each compatibility option, the macros below include a comment showing the related English (US) name used in the user interface of Word.
- You can adjust each individual setting in the macros as desired by changing True to False of vice versa.
MACRO 1 Word 2010 – turn ON all compatibility options
IMPORTANT: Note that some of the compatibility options must be set to False to be turned ON!
With ActiveDocument
'=========================
'Macro created 2020 by Lene Fredborg, DocTools - www.thedoctools.com
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
'=========================
'This macro can be used in documents in Word 2010 format
'THE MACRO TURNS ON ALL 66 WORD 2010 COMPATIBILITY OPTIONS
'IMPORTANT: SOME OPTIONS MUST BE SET TO FALSE TO BE TURNED ON
'=========================
'=========================
'Add space for underlines
'FALSE = TURNED ON!
.Compatibility(wdNoSpaceForUL) = False
'=========================
'Adjust line height to grid height in the table
'FALSE = TURNED ON!
.Compatibility(wdDontAdjustLineHeightInTable) = False
'=========================
'Align table rows independently
.Compatibility(wdAlignTablesRowByRow) = True
'Allow space between paragraphs of the same style in a table
.Compatibility(wdAllowSpaceOfSameStyleInTable) = True
'Allow table rows to lay out apart
.Compatibility(wdLayoutTableRowsApart) = True
'Allow tables to extend into margins
.Compatibility(wdGrowAutofit) = True
'Auto space the way Word 95 does
.Compatibility(wdAutospaceLikeWW7) = True
'=========================
'Balance SBCS characters and DBCS characters
'FALSE = TURNED ON!
.Compatibility(wdDontBalanceSingleByteDoubleByteWidth) = False
'=========================
'Combine table borders the way Word 5.x for the Macintosh does
.Compatibility(wdOrigWordTableRules) = True
'=========================
'Convert backslash characters into yen signs
'FALSE = TURNED ON!
.Compatibility(wdLeaveBackslashAlone) = False
'=========================
'Disable OpenType Font Formatting Features
.Compatibility(wdDisableOTKerning) = True
'Do full justification the way WordPerfect 6.x for Windows does
.Compatibility(wdWPJustification) = True
'Don't add automatic tab stop for hanging indent
.Compatibility(wdNoTabHangIndent) = True
'Don't add extra space for raised/lowered characters
.Compatibility(wdNoSpaceRaiseLower) = True
'Don't add leading (extra space) between rows of text
.Compatibility(wdNoLeading) = True
'Don't allow hanging punctuation with character grid
.Compatibility(wdDontWrapTextWithPunctuation) = True
'Don't autofit tables next to wrapped objects
.Compatibility(wdDontAutofitConstrainedTables) = True
'Don't balance columns at the start of Continuous sections
.Compatibility(wdNoColumnBalance) = True
'Don't break constrained tables forced onto the page
.Compatibility(wdDontBreakConstrainedForcedTables) = True
'Don't break wrapped tables across pages
.Compatibility(wdDontBreakWrappedTables) = True
'Don't center "exact line height" lines
.Compatibility(wdExactOnTop) = True
'=========================
'Don't expand character spaces on a line that ends with SHIFT+RETURN
'FALSE = TURNED ON!
.Compatibility(wdExpandShiftReturn) = False
'=========================
'Don't snap text to grid inside table with inline objects
.Compatibility(wdDontSnapTextToGridInTableWithObjects) = True
'Don't use Asian rules for line breaks with character grid
.Compatibility(wdDontUseAsianBreakRulesInGrid) = True
'Don't use hanging indent as tab stop for bullets and numbering
.Compatibility(wdDontUseIndentAsNumberingTabStop) = True
'Don't use HTML paragraph auto spacing
.Compatibility(wdDontUseHTMLParagraphAutoSpacing) = True
'Don't use proportional width for Korean characters
.Compatibility(wdHangulWidthLikeWW11) = True
'Don't vertically align inside of textboxes
.Compatibility(wdDontVertAlignInTextbox) = True
'Don't vertically align table cells containing shapes
.Compatibility(wdDontVertAlignCellWithShape) = True
'=========================
'Draw underline on trailing spaces
'FALSE = TURNED ON!
.Compatibility(wdDontULTrailSpace) = False
'=========================
'Expand/condense by whole number of points
.Compatibility(wdSpacingInWholePoints) = True
'Forget last tab alignment
.Compatibility(wdForgetLastTabAlignment) = True
'Lay out AutoShapes the way Word 97 does
.Compatibility(wdShapeLayoutLikeWW8) = True
'Lay out footnotes the way Word 6.x/95/97 does
.Compatibility(wdFootnoteLayoutLikeWW8) = True
'Lay out tables with raw width
.Compatibility(wdLayoutRawTableWidth) = True
'Print body text before header/footer
.Compatibility(wdPrintBodyTextBeforeHeader) = True
'Print colors as black on noncolor printers
.Compatibility(wdPrintColBlack) = True
'Select entire field with first or last character
.Compatibility(wdSelectFieldWithFirstOrLastCharacter) = True
'Show hard page or column breaks in frames
.Compatibility(wdShowBreaksInFrames) = True
'Split apart page break and paragraph mark
.Compatibility(wdSplitPgBreakAndParaMark) = True
'Substitute fonts based on font size
.Compatibility(wdSubFontBySize) = True
'Suppress extra line spacing at bottom of page
.Compatibility(wdSuppressBottomSpacing) = True
'Suppress extra line spacing at top of page
.Compatibility(wdSuppressTopSpacing) = True
'Suppress extra line spacing at top of page the way Word 5.x for the Macintosh does
.Compatibility(wdSuppressTopSpacingMac5) = True
'Suppress extra line spacing the way WordPerfect 5.x does
.Compatibility(wdNoExtraLineSpacing) = True
'Suppress Space Before after a hard page or column break
.Compatibility(wdSuppressSpBfAfterPgBrk) = True
'Swap inside and outside mirror indents and relative positioning
.Compatibility(wdFlipMirrorIndents) = True
'Swap left and right borders on odd facing pages
.Compatibility(wdSwapBordersFacingPages) = True
'Treat \* as ** in mail merge data sources
.Compatibility(wdConvMailMergeEsc) = True
'Truncate font height
.Compatibility(wdTruncateFontHeight) = True
'Underline tab character in numbered lists
.Compatibility(wdUnderlineTabInNumList) = True
'Use cached paragraph information for column balancing
.Compatibility(wdCachedColBalance) = True
'Use larger small caps the way Word 5.x for the Macintosh does
.Compatibility(wdMWSmallCaps) = True
'Use line-breaking rules
.Compatibility(wdApplyBreakingRules) = True
'Use Normal style for bulleted and numbered lists
.Compatibility(wdUseNormalStyleForList) = True
'Use printer metrics to lay out document
.Compatibility(wdUsePrinterMetrics) = True
'Use Word 2002 table style rules
.Compatibility(wdUseWord2002TableStyleRules) = True
'Use Word 2002-2007 style evaluation rules for font size and paragraph justification in tables
.Compatibility(wdDontOverrideTableStyleFontSzAndJustification) = True
'Use Word 2003 hanging-punctuation rules
.Compatibility(wdFELineBreak11) = True
'Use Word 2003 indent rules for text next to wrapped objects
.Compatibility(wdWW11IndentRules) = True
'Use Word 2003 kerning pair rules
.Compatibility(wdWord11KerningPairs) = True
'Use Word 2003 table autofit rules
.Compatibility(wdAutofitLikeWW11) = True
'Use Word 6.x/95 border rules
.Compatibility(wdWW6BorderRules) = True
'Use Word 97 line-breaking rules for Asian text
.Compatibility(wdUseWord97LineBreakingRules) = True
'Wrap lines the way Word 6.0 does
.Compatibility(wdLineWrapLikeWord6) = True
'Wrap trailing spaces to next line
.Compatibility(wdWrapTrailSpaces) = True
End With
End Sub
MACRO 2 Word 2010 – turn OFF all compatibility options
IMPORTANT: Note that some of the compatibility options must be set to True to be turned OFF!
With ActiveDocument
'=========================
'Macro created 2020 by Lene Fredborg, DocTools - www.thedoctools.com
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
'=========================
'This macro can be used in documents in Word 2007 format
'THE MACRO TURNS OFF ALL 66 WORD 2010 COMPATIBILITY OPTIONS
'IMPORTANT: SOME OPTIONS MUST BE SET TO FALSE TO BE TURNED ON!
'=========================
'=========================
'Add space for underlines
'TRUE = TURNED OFF!
.Compatibility(wdNoSpaceForUL) = True
'=========================
'Adjust line height to grid height in the table
'TRUE = TURNED OFF!
.Compatibility(wdDontAdjustLineHeightInTable) = True
'=========================
'Align table rows independently
.Compatibility(wdAlignTablesRowByRow) = False
'Allow space between paragraphs of the same style in a table
.Compatibility(wdAllowSpaceOfSameStyleInTable) = False
'Allow table rows to lay out apart
.Compatibility(wdLayoutTableRowsApart) = False
'Allow tables to extend into margins
.Compatibility(wdGrowAutofit) = False
'Auto space the way Word 95 does
.Compatibility(wdAutospaceLikeWW7) = False
'=========================
'Balance SBCS characters and DBCS characters
'TRUE = TURNED OFF!
.Compatibility(wdDontBalanceSingleByteDoubleByteWidth) = True
'=========================
'Combine table borders the way Word 5.x for the Macintosh does
.Compatibility(wdOrigWordTableRules) = False
'=========================
'Convert backslash characters into yen signs
'TRUE = TURNED OFF!
.Compatibility(wdLeaveBackslashAlone) = True
'=========================
'Disable OpenType Font Formatting Features
.Compatibility(wdDisableOTKerning) = False
'Do full justification the way WordPerfect 6.x for Windows does
.Compatibility(wdWPJustification) = False
'Don't add automatic tab stop for hanging indent
.Compatibility(wdNoTabHangIndent) = False
'Don't add extra space for raised/lowered characters
.Compatibility(wdNoSpaceRaiseLower) = False
'Don't add leading (extra space) between rows of text
.Compatibility(wdNoLeading) = False
'Don't allow hanging punctuation with character grid
.Compatibility(wdDontWrapTextWithPunctuation) = False
'Don't autofit tables next to wrapped objects
.Compatibility(wdDontAutofitConstrainedTables) = False
'Don't balance columns at the start of Continuous sections
.Compatibility(wdNoColumnBalance) = False
'Don't break constrained tables forced onto the page
.Compatibility(wdDontBreakConstrainedForcedTables) = False
'Don't break wrapped tables across pages
.Compatibility(wdDontBreakWrappedTables) = False
'Don't center "exact line height" lines
.Compatibility(wdExactOnTop) = False
'=========================
'Don't expand character spaces on a line that ends with SHIFT+RETURN
'TRUE = TURNED OFF!
.Compatibility(wdExpandShiftReturn) = True
'=========================
'Don't snap text to grid inside table with inline objects
.Compatibility(wdDontSnapTextToGridInTableWithObjects) = False
'Don't use Asian rules for line breaks with character grid
.Compatibility(wdDontUseAsianBreakRulesInGrid) = False
'Don't use hanging indent as tab stop for bullets and numbering
.Compatibility(wdDontUseIndentAsNumberingTabStop) = False
'Don't use HTML paragraph auto spacing
.Compatibility(wdDontUseHTMLParagraphAutoSpacing) = False
'Don't use proportional width for Korean characters
.Compatibility(wdHangulWidthLikeWW11) = False
'Don't vertically align inside of textboxes
.Compatibility(wdDontVertAlignInTextbox) = False
'Don't vertically align table cells containing shapes
.Compatibility(wdDontVertAlignCellWithShape) = False
'=========================
'Draw underline on trailing spaces
'TRUE = TURNED OFF!
.Compatibility(wdDontULTrailSpace) = True
'=========================
'Expand/condense by whole number of points
.Compatibility(wdSpacingInWholePoints) = False
'Forget last tab alignment
.Compatibility(wdForgetLastTabAlignment) = False
'Lay out AutoShapes the way Word 97 does
.Compatibility(wdShapeLayoutLikeWW8) = False
'Lay out footnotes the way Word 6.x/95/97 does
.Compatibility(wdFootnoteLayoutLikeWW8) = False
'Lay out tables with raw width
.Compatibility(wdLayoutRawTableWidth) = False
'Print body text before header/footer
.Compatibility(wdPrintBodyTextBeforeHeader) = False
'Print colors as black on noncolor printers
.Compatibility(wdPrintColBlack) = False
'Select entire field with first or last character
.Compatibility(wdSelectFieldWithFirstOrLastCharacter) = False
'Show hard page or column breaks in frames
.Compatibility(wdShowBreaksInFrames) = False
'Split apart page break and paragraph mark
.Compatibility(wdSplitPgBreakAndParaMark) = False
'Substitute fonts based on font size
.Compatibility(wdSubFontBySize) = False
'Suppress extra line spacing at bottom of page
.Compatibility(wdSuppressBottomSpacing) = False
'Suppress extra line spacing at top of page
.Compatibility(wdSuppressTopSpacing) = False
'Suppress extra line spacing at top of page the way Word 5.x for the Macintosh does
.Compatibility(wdSuppressTopSpacingMac5) = False
'Suppress extra line spacing the way WordPerfect 5.x does
.Compatibility(wdNoExtraLineSpacing) = False
'Suppress Space Before after a hard page or column break
.Compatibility(wdSuppressSpBfAfterPgBrk) = False
'Swap inside and outside mirror indents and relative positioning
.Compatibility(wdFlipMirrorIndents) = False
'Swap left and right borders on odd facing pages
.Compatibility(wdSwapBordersFacingPages) = False
'Treat \* as ** in mail merge data sources
.Compatibility(wdConvMailMergeEsc) = False
'Truncate font height
.Compatibility(wdTruncateFontHeight) = False
'Underline tab character in numbered lists
.Compatibility(wdUnderlineTabInNumList) = False
'Use cached paragraph information for column balancing
.Compatibility(wdCachedColBalance) = False
'Use larger small caps the way Word 5.x for the Macintosh does
.Compatibility(wdMWSmallCaps) = False
'Use line-breaking rules
.Compatibility(wdApplyBreakingRules) = False
'Use Normal style for bulleted and numbered lists
.Compatibility(wdUseNormalStyleForList) = False
'Use printer metrics to lay out document
.Compatibility(wdUsePrinterMetrics) = False
'Use Word 2002 table style rules
.Compatibility(wdUseWord2002TableStyleRules) = False
'Use Word 2002-2007 style evaluation rules for font size and paragraph justification in tables
.Compatibility(wdDontOverrideTableStyleFontSzAndJustification) = False
'Use Word 2003 hanging-punctuation rules
.Compatibility(wdFELineBreak11) = False
'Use Word 2003 indent rules for text next to wrapped objects
.Compatibility(wdWW11IndentRules) = False
'Use Word 2003 kerning pair rules
.Compatibility(wdWord11KerningPairs) = False
'Use Word 2003 table autofit rules
.Compatibility(wdAutofitLikeWW11) = False
'Use Word 6.x/95 border rules
.Compatibility(wdWW6BorderRules) = False
'Use Word 97 line-breaking rules for Asian text
.Compatibility(wdUseWord97LineBreakingRules) = False
'Wrap lines the way Word 6.0 does
.Compatibility(wdLineWrapLikeWord6) = False
'Wrap trailing spaces to next line
.Compatibility(wdWrapTrailSpaces) = False
End With
End Sub
VBA – set all compatibility options – Word 2013, 2016, 2019, 2021, 365
Below, you will find two macros, each including code for setting all compatibility options in documents in Word 2013, 2016, 2019, or 365 format. MACRO 1 turns on all compatibility options in the active document. MACRO 2 turns off all compatibility options in the active document.
- Word 2013, 2016, 2019, and 365 include 13 compatibility options. For each compatibility option, the macros below include a comment showing the related English (US) name used in the user interface of Word.
- You can adjust each individual setting in the macros as desired by changing True to False of vice versa.
MACRO 1 Word 2013, 2016, 2019, 2021, 365 – turn ON all compatibility options
IMPORTANT: Note that some of the compatibility options must be set to False to be turned ON!
With ActiveDocument
'=========================
'Macro created 2020 by Lene Fredborg, DocTools - www.thedoctools.com
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
'=========================
'This macro can be used in documents in Word 2013, 2016, 2019, 2021, or 365 format
'THE MACRO TURNS ON ALL 13 WORD 2013, 2016, 2019, 2021, 365 COMPATIBILITY OPTIONS
'IMPORTANT: SOME OPTIONS MUST BE SET TO FALSE TO BE TURNED ON
'=========================
'=========================
'Add space for underlines
'FALSE = TURNED ON!
.Compatibility(wdNoSpaceForUL) = False
'=========================
'Adjust line height to grid height in the table
'FALSE = TURNED ON!
.Compatibility(wdDontAdjustLineHeightInTable) = False
'=========================
'Allow hyphenation between pages or columns
.Compatibility(wdAllowHyphenationAtTrackBottom) = True
'=========================
'Balance SBCS characters and DBCS characters
'FALSE = TURNED ON!
.Compatibility(wdDontBalanceSingleByteDoubleByteWidth) = False
'=========================
'Convert backslash characters into yen signs
'FALSE = TURNED ON!
.Compatibility(wdLeaveBackslashAlone) = False
'=========================
'Don't center "exact line height" lines
.Compatibility(wdExactOnTop) = True
'=========================
'Don't expand character spaces on a line that ends with SHIFT+RETURN
'FALSE = TURNED ON!
.Compatibility(wdExpandShiftReturn) = False
'=========================
'Don't use HTML paragraph auto spacing
.Compatibility(wdDontUseHTMLParagraphAutoSpacing) = True
'=========================
'Draw underline on trailing spaces- FALSE = TURNED ON!
.Compatibility(wdDontULTrailSpace) = False
'=========================
'Suppress extra line spacing at bottom of page
.Compatibility(wdSuppressBottomSpacing) = True
'Suppress extra line spacing at top of page
.Compatibility(wdSuppressTopSpacing) = True
'Use line-breaking rules
.Compatibility(wdApplyBreakingRules) = True
'Use Word 2013 rules for hyphenation between pages and columns
.Compatibility(wdUseWord2013TrackBottomHyphenation) = True
End With
End Sub
MACRO 2 Word 2013, 2016, 2019, 2021, 365 – turn OFF all compatibility options
IMPORTANT: Note that some of the compatibility options must be set to True to be turned OFF!
With ActiveDocument
'=========================
'Macro created 2020 by Lene Fredborg, DocTools - www.thedoctools.com
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
'=========================
'This macro can be used in documents in Word 2013, 2016, 2019, 2021, or 365 format
'THE MACRO TURNS OFF ALL 13 WORD 2013, 2016, 2019, 2021, 365 COMPATIBILITY OPTIONS
'IMPORTANT: SOME OPTIONS MUST BE SET TO FALSE TO BE TURNED ON!
'=========================
'=========================
'Add space for underlines
'TRUE = TURNED OFF!
.Compatibility(wdNoSpaceForUL) = True
'=========================
'Adjust line height to grid height in the table
'TRUE = TURNED OFF!
.Compatibility(wdDontAdjustLineHeightInTable) = True
'=========================
'Allow hyphenation between pages or columns
.Compatibility(wdAllowHyphenationAtTrackBottom) = False
'=========================
'Balance SBCS characters and DBCS characters
'TRUE = TURNED OFF!
.Compatibility(wdDontBalanceSingleByteDoubleByteWidth) = True
'=========================
'Convert backslash characters into yen signs
'TRUE = TURNED OFF!
.Compatibility(wdLeaveBackslashAlone) = True
'=========================
'Don't center "exact line height" lines
.Compatibility(wdExactOnTop) = False
'=========================
'Don't expand character spaces on a line that ends with SHIFT+RETURN
'TRUE = TURNED OFF!
.Compatibility(wdExpandShiftReturn) = True
'=========================
'Don't use HTML paragraph auto spacing
.Compatibility(wdDontUseHTMLParagraphAutoSpacing) = False
'=========================
'Draw underline on trailing spaces
'TRUE = TURNED OFF!
.Compatibility(wdDontULTrailSpace) = True
'=========================
'Suppress extra line spacing at bottom of page
.Compatibility(wdSuppressBottomSpacing) = False
'Suppress extra line spacing at top of page
.Compatibility(wdSuppressTopSpacing) = False
'Use line-breaking rules
.Compatibility(wdApplyBreakingRules) = False
'Use Word 2013 rules for hyphenation between pages and columns
.Compatibility(wdUseWord2013TrackBottomHyphenation) = False
End With
End Sub
Related information
Overview of all compatibility options and information about in which Word versions each option is found: For details about how to access the compatibility options manually via the user interface in Word, see my article Word Layout Options & Compatibility Options. The article also includes lists showing which layout options and compatibility options are found in the different versions of Word.
Show Extended List of Compatibility Options, incl. Word Version Info.
Finding Word terms in another language than your Word: You can use Microsoft language resources
to look up Word terminology in another language than your Word version.
For information about Compatibility Mode in Word, see my article Word Compatibility Mode – What Is It?.