Hi every body,
When i'm using InsertFile method to insert an HTML file containing pictures, they are replaced with grey boxes.
It only occurs on Office 2016.
You can find a related topic at Answers Microsoft where the problem is identical.
You can use this code to reproduce the bug if you want.
string htmlFile = "c:\\MyHtmlFileWithPicutres.html"; string docFile = "c:\\myWordDocument.docx"; object missing = System.Reflection.Missing.Value; object visible = true; Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application(); wordApp.Visible = true; Document doc = wordApp.Documents.Open(docFile, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing , ref missing, ref missing, ref visible, ref missing, ref missing , ref missing, ref missing); doc.Activate(); doc.Range().InsertFile(htmlFile, ref rng, ref confirmConversion, ref link, ref attachment); doc.Close(); wordApp.Quit();
Thanks for your replies.