none
Changes to Protected Document Code Execution in Word 2010? RRS feed

  • Question

  • Can anyone confirm whether there have been changes to document protection in Word 2010?

    I have inheritted a number of Word Templates that were built many years ago and we had some major compatibility issues when we moved from an Office 2003 to 2007 platform. These issues were finally resolved late last year and now we are starting to roll out 2010, we are running into more issues.

    The Word Templates have extensive VBA code which, as well as other things, secures the resultant documents by utilizing the ActiveDocument.ProtectionType

    One of the changes appears to be the ability to set ActiveWindow.View.ShowRevisionsandComments when the ProtectionType is set to wdAllowOnlyFormFields.

    When the same code is run under Word 2007 it works fine, but doing the exact same with Word 2010 results in Run time 4605 (Method or Property not available because the document is protected)

    This is not related to the Trust Center settings - I already have "Enable All Macros" and the macros do run. The problem is that some of the code throws the above error.
    I have been able to resolve the issue by unprotecting the doc immediately before the areas of code that cause the error and then re-protectinng immediately afterwards.
    What I would like is confirmation and explicit details of the changes in Word 2010 that result in the above behaviour - is this documented anywhere?

    Many Thanks
    Gary

    Wednesday, May 18, 2011 8:37 AM

Answers

  • I can replicate your results (no error in a Word 2007 protected document, but a 4605 error in Word 2010 under the same circumstances).

    As far as I'm aware, there is no documentation of this change or anything like it. The change probably wasn't deliberate, but a side effect of something else.

    Because the bug doesn't cause data loss and a workaround (unprotect/reprotect) exists, I suspect there will never be a fix in Word 2010. I will report it, in the hope that it will be fixed in the next version.


    Jay Freedman
    MS Word MVP  FAQ: http://word.mvps.org
    Wednesday, May 18, 2011 8:42 PM