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

ID: Q88499

The information in this article applies to:

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 "as is" 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.

REFERENCES

"Using WordBasic," by WexTech Systems and Microsoft, page 176

"Microsoft Word Developer's Kit," pages 352-353

Kbcategory: kbusage kbmacro KBSubcategory: Additional query words: winword2 size move 509 1.0 1.10 1.10a word7 word6 winword 7.0 word95 2.0 2.0a 6.0

Version           : 1.x 2.x 6.0 6.0a 6.0c 7.0
Platform          : WINDOWS

Last Reviewed: July 30, 1997