none
How do i prevent copy/paste/print in word 2007 RRS feed

  • Question

  • How do i prevent copy/paste/print in word 2007 ? i know we can do it using word add-ins but how ?

    is there any another options for that ?

    i am using Visual studio 2008 with C#

    Thanks in advnace

    Tuesday, December 20, 2011 5:12 AM

Answers

  • Hi Prasad

    The only true way you can prevent this is to use "Information Rights Management". That can lock down a document for you, but it requires everyone who uses the document to be a member of the Active Directory Server's domain that enforces the IRM. If you want to learn more about IRM, search the term on the Microsoft site. The TechNet forums would probably be the best place to discuss the concept in more depth, as it's a network administration technology, not a programming technology.

    Beyond that, you can only "sort of" lock down the commands. You can do it, but it's not guaranteed to always work and a really savvy user can usually find a way to avoid the restriction. Word was never developed as a "Reader", it's a word processor, which means it helps people work with documents. Converting the files to PDF format (for example) might be a better solution as the Adobe Reader is exactly that, a Reader.

    In Word 2007 you can re-purpose the three commands using a Ribbon customization in your add-in. Place a <commands> section in the Ribbon with a <command> element for each command you want to change. Specify the command using its idMso value. In your case, you'll want to set the enabled attribute = fase.

    If you search this and the VSTO forum you'll find any number of Ribbon XML code examples. I answered a related question yesterday that has a couple of links in it:
    http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/09fb748d-3858-4c56-948f-750f2f914f92


    Cindy Meister, VSTO/Word MVP
    • Proposed as answer by JosephFox Tuesday, December 20, 2011 3:56 PM
    • Marked as answer by koolprasadd Wednesday, December 21, 2011 6:11 AM
    Tuesday, December 20, 2011 8:35 AM
    Moderator
  • Cindy's answer makes me think. Since your question suggests you just want to display the documents, you could create your own 'reader'. It wouldn't be that difficult, using OpenXML, to display a document's contents in a windows forms application.
    • Marked as answer by koolprasadd Wednesday, December 21, 2011 6:11 AM
    Tuesday, December 20, 2011 3:56 PM

All replies

  • Hi Prasad

    The only true way you can prevent this is to use "Information Rights Management". That can lock down a document for you, but it requires everyone who uses the document to be a member of the Active Directory Server's domain that enforces the IRM. If you want to learn more about IRM, search the term on the Microsoft site. The TechNet forums would probably be the best place to discuss the concept in more depth, as it's a network administration technology, not a programming technology.

    Beyond that, you can only "sort of" lock down the commands. You can do it, but it's not guaranteed to always work and a really savvy user can usually find a way to avoid the restriction. Word was never developed as a "Reader", it's a word processor, which means it helps people work with documents. Converting the files to PDF format (for example) might be a better solution as the Adobe Reader is exactly that, a Reader.

    In Word 2007 you can re-purpose the three commands using a Ribbon customization in your add-in. Place a <commands> section in the Ribbon with a <command> element for each command you want to change. Specify the command using its idMso value. In your case, you'll want to set the enabled attribute = fase.

    If you search this and the VSTO forum you'll find any number of Ribbon XML code examples. I answered a related question yesterday that has a couple of links in it:
    http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/09fb748d-3858-4c56-948f-750f2f914f92


    Cindy Meister, VSTO/Word MVP
    • Proposed as answer by JosephFox Tuesday, December 20, 2011 3:56 PM
    • Marked as answer by koolprasadd Wednesday, December 21, 2011 6:11 AM
    Tuesday, December 20, 2011 8:35 AM
    Moderator
  • Cindy's answer makes me think. Since your question suggests you just want to display the documents, you could create your own 'reader'. It wouldn't be that difficult, using OpenXML, to display a document's contents in a windows forms application.
    • Marked as answer by koolprasadd Wednesday, December 21, 2011 6:11 AM
    Tuesday, December 20, 2011 3:56 PM
  • Thanks cindy for valuable reply.
    Wednesday, December 21, 2011 6:10 AM
  • Thanks for reply Joseph,

    As you told, do you how to make own 'reader' using OpenXML. any example or sample link ?

    Wednesday, December 21, 2011 6:11 AM
  • I would have replied sooner, but I'm have difficulty getting a 'phone line (and from there an Internet connection) installed at home, and can currently only get online at the library.

    See this http://blogs.msdn.com/b/ericwhite/archive/2010/01/12/mastering-text-in-open-xml-word-processing-documents.aspx. It has a nice couple of paragraphs before linking to an MSDN article. It might seem like a lot at a glance, but if you scroll down there are some succinct examples. It's in C#. Instead of

    Console.WriteLine("Paragraph text >{0}<", text);

    you could enter the text to a windows forms control.

    Thursday, December 22, 2011 12:12 PM