title: C# Interop.Word Adding an Image from project resource folder
body: <p>Having some image problem with Interop.Word and C#. I want to add an image in the header of the document that I am going to generate. I have this code working perfectly</p>
  
  <pre><code>section.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Shapes.AddPicture(@"C:\Logo.jpg", ref x, ref x, ref x, ref x, ref x, ref x, ref x);
  </code></pre>
  
  <p>Problem is that I can't have <code>"C:\Logo.jpg"</code> in the code since after publishing the project, there would most probably be no Logo.jpg in the C folder of the user. The image is already in my project's resource folder. I've used <code>Image.FromFile("Logo.jpg")</code> before but <code>.AddPicture</code> requires a string and not an image.</p>
  
  <p>Any ideas?</p>
  
  <p>-- edit --</p>
  
  <p>Saw this over the net:</p>
  
  <pre><code>string anyPath = @"C:\logo.jpg";
  Properties.Resources.logo.Save(anyPath);
  section.Headers.[...].Shapes.AddPicture(anyPath, ...
  </code></pre>
  
  <p>but then I still get a generic error in GDI+ or ExternalException was unhandled.</p>