none
How to disable 'Properties' button in 'Developer' tab for Word 2007?

    Question

  • Hi all,

    ContentControl in Word 2007 is really a good feature. I can protect specified area by using ContentControl. I also can prevent user modify or delete data by locking ContentControls and contents through code or 'Properties' button in 'Developer' tab.

    But, user also can use 'Properties' button to unlock them then the data may be messed up. This is not what I want, is there any way to disable 'Properties' button in 'Developer' tab for spcified documents and controlled by an Application-Level project? Or there is a better solution?

    Thanks a lot!!

    Tuesday, May 26, 2009 1:27 AM

Answers

  • Hi Cindy,

    I have found the information about re-purposes. But, I also found another problem. Let me describe our scenario simply first,

    1. Our user opens an empty document in Word 2007.
    2. Through addin, our user can add some data protected by ContentControls.
    3. Our user sends the document to client.
    4. Client edits the document exept the areas protected by ContentControls.
    5. Client sends the document back and our user syncs document into system.

    In this scenario, the addin is only installed in our enviroment. Ribbon XML customization can help us to prevent our user not to modify ContentControls embedded in document. In step 4, outside our enviroment, it still have chance that client can modify the content even protected by ContentControls and make the sync result go wrong. How can I solve this problem? Hope the solution is not using a Docuemnt-Level project, due to we want to make thing simple by sending a pure document to client.

    Hi Wade

    Mmm. In your scenario the first question that comes to my mind is: can you ensure the recipients reading the documents will have Office 2007? Only Office 2007 provides Content Control support. If an older version opens such a document the Content Controls are, as I recall, just removed (no more protection).

    Beyond that, it would probably be best to not link any Content Controls to built-in document properties. Map the content controls to a custom XML part, only. If you need the information in a document property, your "synch" code can take care of writing from the XML part to document properties.

    The only other idea that comes to mind would be to embed the Ribbon XML in the document. This can be done independently of your VSTO project - no execution code of any kind would be required in your project or the document (no macros).  In case you're not famliar with this technique, Part I of this article (http://msdn.microsoft.com/en-us/library/aa338202.aspx) describes how to do it manually; you can also use the Custom UI Editor (http://openxmldeveloper.org/archive/2006/05/26/CustomUIeditor.aspx) to streamline this a bit. (You could, of course, use the "Packaging" techniques to add the Ribbon XML part to the document programmatically.)

    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Wade Wu Wednesday, May 27, 2009 5:57 AM
    Tuesday, May 26, 2009 10:07 AM

All replies

  • Hi Wade Wu!

    I'm not sure if this will work for you but you can hide the Developer tab to prevent users from editing content control properties:



    Globals.ThisAddIn.Application.Options.ShowDevTools = false;

    Tuesday, May 26, 2009 1:40 AM
  • Hi Jose Anton Bautista,

    Thanks for your response! I tried, but user still can check 'Word options->Popular->Show Developer tab in the Ribbon' to get the tab back. I think it can confused users but still won't stop them.


    Tuesday, May 26, 2009 3:40 AM
  • Hi Wade

    You should be able to define a Ribbon XML customization for that add-in that re-purposes the button in the Office menu. The idMso of that button is: FileProperties.

    If you need examples of the Ribbon XML for repurposing, search this forum for the terms: <commands><command>
    Cindy Meister, VSTO/Word MVP
    Tuesday, May 26, 2009 6:37 AM
  • Hi Cindy,

    I have found the information about re-purposes. But, I also found another problem. Let me describe our scenario simply first,

    1. Our user opens an empty document in Word 2007.
    2. Through addin, our user can add some data protected by ContentControls.
    3. Our user sends the document to client.
    4. Client edits the document exept the areas protected by ContentControls.
    5. Client sends the document back and our user syncs document into system.

    In this scenario, the addin is only installed in our enviroment. Ribbon XML customization can help us to prevent our user not to modify ContentControls embedded in document. In step 4, outside our enviroment, it still have chance that client can modify the content even protected by ContentControls and make the sync result go wrong. How can I solve this problem? Hope the solution is not using a Docuemnt-Level project, due to we want to make thing simple by sending a pure document to client.

    Tuesday, May 26, 2009 9:41 AM
  • Hi Cindy,

    I have found the information about re-purposes. But, I also found another problem. Let me describe our scenario simply first,

    1. Our user opens an empty document in Word 2007.
    2. Through addin, our user can add some data protected by ContentControls.
    3. Our user sends the document to client.
    4. Client edits the document exept the areas protected by ContentControls.
    5. Client sends the document back and our user syncs document into system.

    In this scenario, the addin is only installed in our enviroment. Ribbon XML customization can help us to prevent our user not to modify ContentControls embedded in document. In step 4, outside our enviroment, it still have chance that client can modify the content even protected by ContentControls and make the sync result go wrong. How can I solve this problem? Hope the solution is not using a Docuemnt-Level project, due to we want to make thing simple by sending a pure document to client.

    Hi Wade

    Mmm. In your scenario the first question that comes to my mind is: can you ensure the recipients reading the documents will have Office 2007? Only Office 2007 provides Content Control support. If an older version opens such a document the Content Controls are, as I recall, just removed (no more protection).

    Beyond that, it would probably be best to not link any Content Controls to built-in document properties. Map the content controls to a custom XML part, only. If you need the information in a document property, your "synch" code can take care of writing from the XML part to document properties.

    The only other idea that comes to mind would be to embed the Ribbon XML in the document. This can be done independently of your VSTO project - no execution code of any kind would be required in your project or the document (no macros).  In case you're not famliar with this technique, Part I of this article (http://msdn.microsoft.com/en-us/library/aa338202.aspx) describes how to do it manually; you can also use the Custom UI Editor (http://openxmldeveloper.org/archive/2006/05/26/CustomUIeditor.aspx) to streamline this a bit. (You could, of course, use the "Packaging" techniques to add the Ribbon XML part to the document programmatically.)

    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Wade Wu Wednesday, May 27, 2009 5:57 AM
    Tuesday, May 26, 2009 10:07 AM
  • Hi Cindy,

    No, I can't ensure and I understand ContentControls will be removed in older version. But I think it won't be a technology issue and our PM will take care of this. :-P

    What you provide is really really useful and I'm studing. It is good enough for our current requirement. Thanks again!!!


    Wednesday, May 27, 2009 5:59 AM