Thanks Graham, this pointed me in the right direction!
This is my solution.
foreach (Word.Section section in objDocument.Sections)
{
headerfooter = section.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage];
try
{
for (int i = 0; i < headerfooter.Range.InlineShapes.Count; i++)
{
inlineshape = headerfooter.Range.InlineShapes[i + 1];
inlineshape.Delete();
headerfooter.Range.InlineShapes.AddPicture(workparams.imagepath, ref linktofile, ref savewithdocument, ref Unknown);
}
}
catch (Exception ex)
{
throw;
}
headerfooter = section.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary];
try
{
for (int i = 0; i < headerfooter.Range.InlineShapes.Count; i++)
{
inlineshape = headerfooter.Range.InlineShapes[i + 1];
inlineshape.Delete();
headerfooter.Range.InlineShapes.AddPicture(workparams.imagepath, ref linktofile, ref savewithdocument, ref Unknown);
}
}
catch (Exception ex)
{
throw;
}
}