Domanda

I have a MS Office Word addin that contacts a service to upload and checkin the current Active document into SharePoint and does some other magic. My issue is that if I try to save the document again I get an error in the Status bar of Word saying that a refresh is needed.

I have tried to use the Interop.Word _Document object to refresh the document or to reload the document but it does not work, and the _Document.Sync.GetUpdate() seems to not even do anything.

Also I tried using the SharePoint Object Model but ran into a few issues.

So the question is How can I refresh the document inside Word using the Interop libraries or another API that I might be missing?

PS: I already asked this question on https://stackoverflow.com/questions/31789474/refresh-sharepoint-document-programmatically-in-ms-word-addin but I was unsure it would also be seen by this community.

È stato utile?

Soluzione

The problem is, that the code in the background changes the document in SharePoint, so word will inform you that there is a newer version. The same thing happens if you have a EventReceiver on the DocumentLibrary, that would make changes to the document upon document updates.

Have you tried explicitely checking out the document before starting to work with it?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top