Protecting and unprotecting Word docs and Excel Workbooks when using Office Web apps RRS feed

  • Question

  •  I am aware of being able to use the OOXML SDK to remove or place protection on a document before it is opened or after it is closed. The example node for document read only protection below from the "Settings.xml" file is from a Word document I am testing. 

    <w:documentProtection w:salt="9/iU+rInMwE+qZVLnaFRew==" w:hash="xVnU3MQb1Jo7U6PpeSm//FkSM3VaOMrcG7tURZ3SIFaB5ktn5JveFxzjQS440B98NqW9kR4XurvkmgEOqf4tVA==" w:cryptSpinCount="100000" w:cryptAlgorithmSid="14" w:cryptAlgorithmType="typeAny" w:cryptAlgorithmClass="hash" w:cryptProviderType="rsaAES" w:enforcement="1" w:edit="readOnly"/>

    The issue for me is that the Office Web API or Office Web application engine does not generate events like open, close or something similar where I could either place the above node into the Open XML settings.xml file for protecting or remove it for unprotecting based on opening it, saving it or closing the document on the Office Web. It is of course easy to do on the client since there are events but just not sure how to do it on the Office web if it is even possible. Any ideas how this can be done?


    Tuesday, May 27, 2014 5:59 PM

All replies

  • Hi Jim,

    As far as I know, there is no automation in Office Online.

    At present, JavaScript API for Office (v1.1) is used to build an app for Office and use JavaScript and HTML to do automation for selections or bindings.

    I’m afraid there is no way to delegate document level events if you want to use JavaScript API for Office.

    I wonder why you want to encrypt the document.

    Based on my understanding, it is because we need to secure the document on local disk (like flash drive, SD card). But to access the document online, you need to provide the credentials every time, it is already secured by the OneDrive, SharePoint or other systems.

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, May 29, 2014 1:00 AM
  • George I am not referring to encrypting the document but setting protection so that it is read only and a password is needed to unprotect it so it is no longer read only. If the document or workbook is protected by a password and sent to someone one else then they can open and see the contents but can't modify the contents unless they know the password. This also protects the content from being easily copied because there is as part of the read only setting that prevents someone from copying the content. You try to put cursor on a specific line in a protected Word document or Excel Workbook the cursor is moved to the first line or first Cell.  On the client there is a way to un-protect or protect the Document or Workbook manually using a password but the Web version doesn't even allow that. Businesses that make a point of protecting their document as I describe will hesitate to use the Office web as a vehicle to access protected documents or workbooks thereby forcing them to use the client version. Even the recent tablet versions of Word and Excel does not have a option to manually protect or un-protect documents or Workbooks. There is a business need for use of the standard protection that can be placed on these documents as I describe.


    Thursday, May 29, 2014 3:19 AM