title: Microsoft.Office.Interop.Word Selection.InsertFile() Method->How to use Bookmark in Range Parameter
body: <p>We're doing an update to an MS Word Add-In that allows users to insert MS Word files into a central MS Word document by using the following function:</p>
  
  <pre><code> //Created rng variable
   Microsoft.Office.Interop.Word.Range rng = Globals.ThisAddIn.Application.Selection.Range;
  //MS Interop method.
  Globals.ThisAddIn.Application.Selection.InsertFile(
       filename,
       rng,//&lt;--Added range                              
       ref missing, //Confirm Conversions
       ref falsevalue, //Link file
       ref falsevalue //Attachment
  );
  </code></pre>
  
  <p>The second parameter: </p>
  
  <pre><code>ref missing, //Range - For Word can be a bookmark
  </code></pre>
  
  <p>Seems to say that we can pass a Range parameter that can be a bookmark (which we 
       can use to delete the added content, if needed), however we haven't been able to find any implementation examples that demonstrate how this is done.</p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.selection.insertfile.aspx" rel="nofollow noreferrer">MSDN</a> describes this parameter as follows:
  <hr>
  <strong><em>Range</em></strong></p>
  
  <p><strong><em>Type: System.Object</em></strong></p>
  
  <p><strong><em>Optional Object.</em></strong> </p>
  
  <p><strong><em>If the specified file is a Word document, this parameter refers to a bookmark. If the file is another type (for example, a Microsoft Excel worksheet), this parameter refers to a named range or a cell range (for example, R1C1:R3C4).</em></strong>
  <hr>
  Since we want to insert a new bookmark with the text, we assumed that we need to: </p>
  
  <ol>
  <li>Create a new bookmark, and </li>
  <li>Pass it into the InsertFile parameter list</li>
  </ol>
  
  <p>However at this point, since we can't find any examples of how this is achieved, we're at a stopping point.</p>
  
  <p>We also found examples such as these:</p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/microsoft.office.tools.word.bookmark.bookmarks(v=vs.120).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/microsoft.office.tools.word.bookmark.bookmarks(v=vs.120).aspx</a></p>
  
  <p><a href="http://www.c-sharpcorner.com/article/add-replace-and-remove-bookmarks-in-word-using-c-sharp/" rel="nofollow noreferrer">http://www.c-sharpcorner.com/article/add-replace-and-remove-bookmarks-in-word-using-c-sharp/</a></p>
  
  <p>But it doesn't look like their implementations are using Word Interop or Selection.InsertFile().</p>
  
  <p>Intellisense doesn't seem to indicate a Range property on Microsoft.Office.Interop.Word.Bookmark:</p>
  
  <p><a href="https://i.stack.imgur.com/j665L.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j665L.jpg" alt="enter image description here"></a></p>
  
  <p>Thanks.</p>