You are viewing limited content. For full access, please sign in.

Question

Question

SDK check if doc open from a repository in word

SDK
asked on September 19, 2018

I have a vsto project that creates a ribbon menu for a customized LaserFiche plugin. Might be overkill, but we have quite a few things that we need to do over and above the standard LF plugin.

I have attached an event - on startup - that automatically logs into to a repo of the users choosing. In that startup event I am setting up a trigger for DocumentOpen - in case the user opens a document directly from the LF client (right click -> edit electronic document). The standard LF plugin picks up that the document is from a repo and enables checkout etc.

 

I want to be able to check if the Opened doc (at this point it is already downloaded to %temp%) is from a repository.

 

Can this be done?

0 0

Replies

replied on September 19, 2018

If the user opens the word document for editing, a new registry key will be created under HKEY_CURRENT_USER\SOFTWARE\Laserfiche\Client8\Profile\Files Monitored with details about the repository/username/docID/file path. You can look in here when the document is opened and see if the path matches. Also, the document is saved under %temp%\documentName_docID, so your code could extract docID and call Laserfiche.RepositoryAccess.Document.GetDocumentInfo to check if the ID corresponds to a document in the repository (probably should also check that the filename matches the document name in case there are multiple repositories).

However, it sounds like your menu could easily interfere with the operation of the LF add-in. Can you elaborate on what kind of operations your menu would be performing on the document?

0 0
replied on September 19, 2018

Thanks. Looks doable. Yes - as I have developed the solution I began to realize that I was replicating much of what the existing plugin does. We have an in house branded templating tool - also a word VBA addin.

The idea is that we interrogate the LF doc on save and add a reference based on entryid / version to the document content. There are many ways to skin this cat. I could have done this in a custom c# script on wf on the server - on update / create but then I would probably have to have the word interop libraries installed on the wf server - which is an option but not an ideal one.

On the workstation the same situation but with a VSTO add-in I can also ensure that the interop is there with my deployment.

Definitely do not want to complete rewrite the plugin but as the VB branding stuff is due a refresh it may just be an opportunity to make that more LF aware.

Hope that answers your question.

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.