.docx 파일을 .html로 변환하고 싶습니다. 나는 C#에서 일한다. 내 코드는 다음과 같습니다..docx를 html로 변환
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document wordDoc = new Microsoft.Office.Interop.Word.Document();
Object oMissing = System.Reflection.Missing.Value;
wordDoc = word.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
word.Visible = false;
Object filepath = @"C:\Users\John\Desktop\begin.docx";
Object confirmconversion = System.Reflection.Missing.Value;
Object readOnly = false;
Object saveto = @"C:\Users\John\Desktop\result.html";
Object oallowsubstitution = System.Reflection.Missing.Value;
wordDoc = word.Documents.Open(ref filepath, ref confirmconversion, ref readOnly, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing);
object fileFormat = WdSaveFormat.wdFormatHTML;
wordDoc.SaveAs(ref saveto, ref fileFormat, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oallowsubstitution, ref oMissing,
ref oMissing);
문제는 헤더와 바닥 글이 포함되지 않는 것입니다. 그들은 .html 결과 파일에 없습니다. 결과에 어떻게 포함시킬 수 있습니까?
수동으로 해 보았습니까? Word에서 HTML로 저장하는 것을 의미합니다. 머리글과 바닥 글이 포함되어 있습니까? – Snowbear
예, 시도했지만 그렇지 않습니다. –
(상업) 라이브러리는 옵션입니까? – Yahia