title: How to add footer that is uneditable using interop in c#
body: <p>I use this code to add a footer to a word document, but I want to make the footer read-only or uneditable if opened by an application. Is this possible? I searched on the net, but there isn't mention anywhere how to make it uneditable.</p>
  
  <pre><code>Word.Application wordApp = null;
  
          // word document
          document = null;
  
          try
          {
              wordApp = new Word.Application();
              //WordApp.Visible = true;
              // open
              document = wordApp.Application.Documents.Open(wordpath);
  
              foreach (Word.Section wordSection in document.Sections)
              {
                  //Get the footer range and add the footer details.
                  Word.Range footerRange = wordSection.Footers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range;
                  footerRange.Font.ColorIndex = Word.WdColorIndex.wdGray50;
                  footerRange.Font.Size = 15;
                  footerRange.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;
                  footerRange.Text = wordHeaderName;
  
              }
  
              // save 
              document.Save();
          }
          finally
          {
              // close excel document &amp; application
              if (document != null)
              {
                  try
                  {
                      document.Close(Word.WdSaveOptions.wdDoNotSaveChanges);
                  }
                  catch { }
              }
  
              if (wordApp != null)
              {
                  try
                  {
                      wordApp.Quit();
                  }
                  catch { }
              }
          }
  </code></pre>