I'm getting the following error when trying to insert a logo. My code looks for the paragraph containing
and then attempts to replace it with a dynamically loaded image.
private static void InsertLogo(DocX doc, string rootPath)
var placeholder = doc.Paragraphs.First(p => p.Text.Contains("<logo>"));
var logo = doc.AddImage(Path.Combine(rootPath, "logo.jpg"));
Upon opening the saved doc, Word 2013 gives me this:
and then this:
If I click
it appears to have inserted it correctly, but I do not want my users thinking that their generated documents are corrupt.