WD: LockDocument Command Does Not Unlock Subdocuments

Last reviewed: February 3, 1998
Article ID: Q117510
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows NT, version 6.0
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Word for the Macintosh, versions 6.0, 6.0.1 6.0.1a

SYMPTOMS

When you run the WordBasic "LockDocument 0" statement, with the insertion point in the master document, Word does not remove the read-only protection from (that is, unlock) the subdocuments, as expected.

The WordBasic LockDocument statement should work as described on page 559 of the "Microsoft Word Developer's Kit" or in the Help file for WordBasic. These sources state that the LockDocument statement adds or removes read- only protection for a document's subdocuments if the insertion point is within the master document when the macro is run.

WORKAROUND

To unlock the subdocuments using a macro containing the "LockDocument 0" command, you must manually place the insertion point in each subdocument before running the macro. You can create a routine to unlock all the subdocuments by including the "LockDocument 0" command in a While. . .Wend loop.

STATUS

Microsoft has confirmed this to be a problem in the Word versions listed above. This problem was corrected in Word 97 for Windows and Word 98 Macintosh Edition.

REFERENCES

"Microsoft Word Developer's Kit," version 6.0, page 559 "Microsoft Word Developer's Kit," Third Edition, page 624


Additional query words:
Keywords : macword ntword winword word6 word7 word95 wordnt kbmacro
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a; MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH Win95 WINDOWS winnt
Issue type : kbbug
Solution Type : kbworkaround


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: February 3, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.