SYMPTOMS
When you attempt to access the
Use Word 97 line
breaking rules for Asian text compatibility property through a macro,
you may receive the following error message:
Run-time
error '5843':
One of the values passed to this method or property is
out of range.
This error message may appear when you run macro code
similar to either of the following examples:
MsgBox ActiveDocument.Compatibility(wdUseWord97LineBreakingRules)
ActiveDocument.Compatibility(wdUseWord97LineBreakingRules) = True
WORKAROUND
Microsoft provides programming examples for illustration only,
without warranty either expressed or implied. This includes, but is not limited
to, the implied warranties of merchantability or fitness for a particular
purpose. This article assumes that you are familiar with the programming
language that is being demonstrated and with the tools that are used to create
and to debug procedures. Microsoft support engineers can help explain the
functionality of a particular procedure, but they will not modify these
examples to provide added functionality or construct procedures to meet your
specific requirements.
For more information about how to use the sample
code in this article, click the article number below to view the article in the
Microsoft Knowledge Base:
212536
OFF2000: How to Run Sample Code from Knowledge Base Articles
Use the following sample macro code to turn on the
Use
Word 97 line breaking rules for Asian text compatibility setting:
WordBasic.ToolsOptionsCompatibility UseWord97LineBreakingRules:=1
Use the following sample macro code to turn off the
Use Word 97
line breaking rules for Asian text compatibility setting:
WordBasic.ToolsOptionsCompatibility UseWord97LineBreakingRules:=0
Use the following sample macro code to test the current value of the
Use Word 97 line breaking rules for Asian text compatibility
property:
Dim dlg As Object
Set dlg = WordBasic.DialogRecord.ToolsOptionsCompatibility(False)
WordBasic.CurValues.ToolsOptionsCompatibility dlg
If dlg.UseWord97LineBreakingRules = 1 Then
MsgBox "UseWord97LineBreakingRules is enabled."
Else
MsgBox "UseWord97LineBreakingRules is disabled."
End If