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

Last reviewed: July 30, 1997
Article ID: 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 "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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.