Inserting HTML into Word Using OpenXML
问题 I have some HTML stored in a database that I want to insert into a Word document using DocumentFormat.OpenXml. Inspired by the article here, I tried the following code. mainPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.Xhtml, String.Format("<html><body>{0}</body></html>", html)); But this gives me the following error. '(My HTML Here)' ID is not a valid XSD ID I really don't understand this error. Does anyone know what I'm doing wrong? Also, my biggest concern about this