Microsoft KB Archive/88499

{|
 * width="100%"|

WinWord Err Msg: 'WordBasic Err=509,' with DocSize or DocMove

 * }

Q88499

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 1.0, 1.1, 1.0a, 2.0, 2.0a, 2.0c, 6.0, 6.0a, 6.0c
 * Microsoft Word for Windows 95, version 7.0

-

SUMMARY
When you use the Microsoft Word for Windows WordBasic DocMove and DocSize commands, make sure the document window is not maximized. If the document window is maximized when the DocMove or DocSize commands are called from a WordBasic macro, you will receive the following error message:

WordBasic Err=509 Command is unavailable.

The DocSize and DocMove commands require the Word for Windows document window to be in a restored state. The following macro checks to see if the document window is maximized and changes it to a restored state:

  Sub MAIN If DocMaximize Then DocMaximize DocSize 540, 250 DocMove 20, 40 End Sub

MORE INFORMATION
To restore the document window before using the DocSize and DocMove commands, use one of the following statements:

  If DocMaximize Then DocMaximize "-or-"   If DocMaximize Then DocRestore Adding one of the above statements before the DocSize and DocMove commands will allow the document window to be sized and moved regardless of whether the window is maximized.

Note: Microsoft provides macros &quot;as is&quot; without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.