Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Aug 2002
    Location
    Harrisburg, Pennsylvania, USA
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Avoid 'locked for editing' dialog? (Word 2000)

    Is it possible to suppress the "This document is locked for editing..." message that Word displays when trying to open a document that someone else already has open? I know that some dialogs and warnings can be avoided by using Application.DisplayAlerts, but apparently this one is displayed regardless.

    Thanks!

  2. #2
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Avoid 'locked for editing' dialog? (Word 2000)

    I'm guessing it depends on what you want Word to do instead, as two users can't be editing the same file at the same time. (Or to be more accurate, they could both edit the document, but one of their edits would be lost). You can set Word documents to always open in "Read-only" mode to stop people locking it for editing, although you may well get a "This document is read-only" message instead.

    Post 223813 highlights a bug that bypasses the message, but with unpleasant consequences! (And it's an expensive workaround as it could involve buying another computer!!) The bottom line here is that the message is there for a very good reason, and you need to think carefully about how you're going to handle file-sharing if you don't use the default options.

    Hope this helps,
    Waggers
    If at first you do succeed, you've probably missed something.

  3. #3
    Lounger
    Join Date
    Aug 2002
    Location
    Harrisburg, Pennsylvania, USA
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Avoid 'locked for editing' dialog? (Word 2000)

    I was asking on behalf of one of our programmers, who is trying to automate Word to do a mail merge as part of a larger process (I'm not perfectly clear on all the details). Sometimes he is trying to open the merge document when another process has it open, which is causing the "locked for editing" dialog. He is not going to be editing the document, so it shouldn't hurt (as far as I know!) to just open it as a read-only document, continue with the merge, and then close it again. The whole thing needs to eventually run completely hands-off on an unmonitored batch processor, so we need to avoid any messages or dialog boxes, or find ways to handle them when they appear.

    Thanks!

  4. #4
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Avoid 'locked for editing' dialog? (Word 2000)

    Ah, in that case it's possible to specify in the code to open the document as read-only:

    Documents.Open "Filename", , True

    That should solve the problem; if it doesn't, I'm afraid I'm out of ideas... <img src=/S/sorry.gif border=0 alt=sorry width=15 height=15>
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  5. #5
    Lounger
    Join Date
    Aug 2002
    Location
    Harrisburg, Pennsylvania, USA
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Avoid 'locked for editing' dialog? (Word 2000)

    We played with that a little bit yesterday, but it seemed that even when opening a document specifically as read-open (either manually in Word or via code), we still get the warning message -- even though it seems overkill at that point, to tell you that you can only open a document read-only when you've asked Word to open it read-only! I believe that they're going to try an end-run around the problem by making a separate copy of the merge document with a unique name, using that for the merge process, and then deleting it when done. Not nearly as elegant as suppressing a dialog, but it ought to work.

    Thank you anyway!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •