Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations
Word 2007 and Sharepoint Workflows

I've got a couple of questions about Word 2007 integration with Sharepoint 2007, and several problems that occur because of it:

The Mysterious Checked-Out Error

Let's say I have a workflow attached to a document library which creates a data collection task, and when that task is completed updates the document metadata with the task data (say, "Ask for Comments"). For some reason if I leave the document open in Word and complete the task, I get an error in the workflow claiming the document is checked out and can't be updated.

Needless to say, the document isn't. Word only checks out the document before the actual save operation, not whenever it's open. If my workflow updates the metadata directly, without a data collection task, it does work. If Word is closed - it does work.

Even more strangely - if instead of updating the metadata I try to delete the item, it works without a hitch. Update - no. Delete - no problem.

I'm pretty much stumped here, and I'd appreciate any idea.

 

Automatically Closing Word's Connection

Now we have a different workflow - once I've saved my document to the library, a workflow evaluates the metadata and moves it to a new folder depending on the context. Copied aside and then erased, or possibly renamed based on some bit of metadata. The workflow works fine and the document vanishes from the library, but Word is still open and still points to the original location. If the user corrects a single word and presses Ctrl-S, the document will be resaved to the original location, the workflow restarted an a new copy made.

Is there a way to force Word to update the folder or file it's pointing to? Alternately, a way to cause Word to close the document after saving?

Published Wednesday, February 21, 2007 12:22 AM by Avner Kashtan

Filed under: ,

Comments

# re: Word 2007 and Sharepoint Workflows@ Friday, February 23, 2007 12:09 PM

Hey Avner,

As far as I know - there are two types of locks to a document:

1. The document is checked out to another user (explicitly).

2. The document is open for editing. If you use the "Edit in Microsoft Office Word" option, Word creates a "short term lock" on the document, in order to prevent a conflict with another user that tries to edit your open document. This lock will be removed when the document is closed from editing.

You can also call this an implicit check-out, and that's why you're receiving the check out error.

Dor.

Dor Rotman

# re: Word 2007 and Sharepoint Workflows@ Friday, February 23, 2007 12:17 PM

Hey there, Dor. Thanks for answering.

I didn't know about this short-term lock, though I suspected something similar is involved. Still, this does not explain why keeping the document open doesn't prevent my workflow from erasing the document, only from modifying the metadata. And also, only when it's in a later, asynchronous stage of the workflow - modifying it immediately does work.

Is there any official documentation about this short-term lock?

Avner Kashtan

# re: Word 2007 and Sharepoint Workflows@ Friday, February 23, 2007 12:28 PM

Sorry, I couldn't find any official resources on this issue.. :)

Dor Rotman

# re: Word 2007 and Sharepoint Workflows@ Sunday, March 18, 2007 3:18 PM

I have just loaded Offivce 2007 and have a problem using Word with Sharepoint,

When I open a document from Sharepoint (either developed in 2007 or earlier incarnation)the docuemnt oipens OK. When I click on edit document, I get an error message saying that an unknown error is trying to lock the document. Word stops responding and must nbe closed.

Can you suggest an answer, or where I may get one

Thanks

Les

Les August

Leave a Comment

(required) 
(required) 
(optional)
(required)