locked
How does one mark a word 2007 document as Mark as Final, Protect Document or Read Only with code? RRS feed

  • Question

  • I am using C# and Open XML file formats to create a word document, but I need to mark it read only as best we can.  Thanks.

    Wednesday, November 4, 2009 4:19 PM

Answers

  • SDK doesn't support save as read-only, you can use System.IO.File to do this.
    • Marked as answer by KiteSurf Monday, November 23, 2009 11:22 PM
    Wednesday, November 11, 2009 2:18 AM
  • Please try the following code:
                System.IO.FileInfo fi = new System.IO.FileInfo(filename);
                fi.IsReadOnly = false;
    • Marked as answer by KiteSurf Monday, November 23, 2009 11:22 PM
    Wednesday, November 11, 2009 3:34 AM

All replies

  • SDK doesn't support save as read-only, you can use System.IO.File to do this.
    • Marked as answer by KiteSurf Monday, November 23, 2009 11:22 PM
    Wednesday, November 11, 2009 2:18 AM
  • Please try the following code:
                System.IO.FileInfo fi = new System.IO.FileInfo(filename);
                fi.IsReadOnly = false;
    • Marked as answer by KiteSurf Monday, November 23, 2009 11:22 PM
    Wednesday, November 11, 2009 3:34 AM