title: Converting .Selection.Find.Style from Word VBA to C#
body: <p>I am converting an old legacy VB program to C#. One of the methods involves find (and return) text in a Word document that match a specific Word Style.</p>
  
  <p>in the original VB code, there is the following line of code:</p>
  
  <pre><code>With objword
     ...
     .Selection.Find.Style = .ActiveDocument.Styles(StyleCode)
     ...
  End With
  </code></pre>
  
  <p>This is what I am trying to do in C# (using Word Interop):</p>
  
  <pre><code>_wordObject.Selection.Find.Style = _wordObject.ActiveDocument.Styles[styleCode];
  </code></pre>
  
  <p>When I try to compile the program I get an error message that says:</p>
  
  <pre><code>'Microsoft.Office.Interop.Word.Find.Style' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop.Word.Find.get_Style()' or 'Microsoft.Office.Interop.Word.Find.set_Style(ref object)'
  </code></pre>
  
  <p>When I try to use get_Style, I am told that it does not take any parameters, and to use the index property, OR that I cannot apply indexing to an expression of type 'method group'</p>
  
  <p>What do I need to do in C# to find text in a Word Document by Word Style?</p>