title: Word Automation: Replace an Image using C#
body: <p>I'm trying to change text and images in a word document using c# and word automation. I've got it working fine for text where I do something like the snippet below, but I don't even know how to start for replacing the image.</p>
  
  <p>Any help is greatly appreciated!</p>
  
  <p>Oliver</p>
  
  <pre><code>using Microsoft.Office.Interop.Word;
  ...
  
  private static Application WordApp;
  private static object missing = System.Reflection.Missing.Value;
  private static object yes = true;
  private static object no = false;
  
  ...
  object search;
  object replace;
  
  object replaceAll =
      Microsoft.Office.Interop.Word.WdReplace.wdReplaceAll;
  
  object filename = SourceFile;
  object destination = DestinationFile;
  
  Document d = WordApp.Documents.Open(
      ref filename, ref missing, ref missing, ref missing, ref missing,
      ref missing, ref missing, ref missing, ref missing, ref missing,
      ref missing, ref missing, ref missing, ref missing, ref missing,
      ref missing);
  
  d.Activate();
  search = "OLDSTRING";
  replace = "NEWSTRING";
  WordApp.Selection.Find.Execute(
      ref search, ref yes, ref yes, ref no, ref no, ref no, ref yes,
      ref missing, ref missing, ref replace, ref replaceAll,
      ref missing, ref yes, ref missing, ref missing);
  </code></pre>