title: "You are not allowed to edit this selection because it is protected." but only since Office 2013?
body: <p>We've had these few lines of code running happily in our applications for several years (and in several versions of Office, 2003, 2007, 2010 etc). Purpose is to perform a kind of a mail merge in a Word document, substituting the field placeholders with names, addresses etc from a database:</p>
  
  <pre><code>    Dim w As Word.Application
      Dim d As Microsoft.Office.Interop.Word.Document = Nothing
  </code></pre>
  
  <p>...</p>
  
  <pre><code>    Dim f As Microsoft.Office.Interop.Word.Field
      For Each f In d.Fields
          f.Select()
          If fieldName = w.Selection.Text Then
              f.Result.Text = value
          End If
      Next
  </code></pre>
  
  <p>However a user running Office 2013 reports this error on the line <code>f.Result.Text = value</code>: </p>
  
  <blockquote>
    <p>System.Runtime.InteropServices.COMException (0x800A17EC): You are not
    allowed to edit this selection because it is protected.</p>
  </blockquote>
  
  <p>So, this is only happening when the user is running Office 2013 and there's very little online help for this error.</p>
  
  <p>No part of the document is protected, and the user can edit the document directly in Word without any problem.</p>