WD2000: Run-time Error 5843 When You Set wdUseWord97LineBreakingRules Compatibility Option (266073)



The information in this article applies to:

  • Microsoft Word 2000

This article was previously published under Q266073

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)
				

-or-

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
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbbug kbdtacode kbfix kbmacroexample kbProgramming KB266073