title: How do I access an image name from MS Word in C#.NET?
body: <p>I am trying to automate a task in C# whereby I loop through images in a word (docx) file and change images based on the image name (renamed under the Selection Pane). 
  I can't seem to find where to access the name property of the image?</p>
  
  <p>Test code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using Word = Microsoft.Office.Interop.Word;
  
  namespace wordReplace
  {
      class Program
      {
          private static Word.Application app;
          private static object yes = true;
          private static object no = false;
          private static object missing = System.Reflection.Missing.Value;
  
          static void Main(string[] args)
          {
              try
              {
                  app = new Word.Application();
                  app.Visible = true;
                  Word.Document d;
                  object filename = @"C:\test.docx";
                  d = app.Documents.Open(ref filename, ref missing, ref no, ref missing,
                     ref missing, ref missing, ref  missing, ref  missing, ref  missing,
                     ref  missing, ref missing, ref yes, ref  missing, ref  missing, ref  missing, ref  missing);
                  List&lt;Word.Range&gt; ranges = new List&lt;Word.Range&gt;();
                  foreach (Word.InlineShape s in d.InlineShapes)
                  {
                      //need to access the image name property here!!
                  }
                  app.Quit(ref no, ref missing, ref missing);
              }
              catch (Exception x)
              {
                  Console.WriteLine(x.Message);
                  app.Quit(ref no, ref missing, ref missing);
              }
          }
      }
  }
  </code></pre>