Detect SharePoint lock

  • Thread starter American since 1749
  • Start date
A

American since 1749

When I open a doc from SharePoint that someone else already has open,
I get a "File In Use" dialog with two choices: A) open read-only or B)
edit the file and merge changes when the file becomes available.

Using WithEvents and Sub Document_Open(), I want to detect that a
document has been opened in either way. If I choose A, detection is
easy: If ActiveDocument.ReadOnly Then ...

But if I choose B, the document is of course not read-only. How can I
detect that the document cannot be saved until the lock is released?
I have tried ActiveDocument.LockServerFile, but I get the same result
--
a run-time error 5891, property not available on that object -- for
all documents, whether someone else has them open or not.

Alternatively, can I detect that the "File In Use" dialog has been
shown at all, no matter what choice was made? Ideally, can I replace
the "File In Use" dialog with one of my own?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top