1
단어 내보내기 기능을 만들려고하지만 내 콘텐츠에 html 태그가 있습니다. html 파일에이 내용을 넣었습니다. 을 <
으로 바꿉니다. 원하는 내용이 아닙니다.C# <을 <HTML 파일로 바꾸기
누군가가 도와 줄 수 있습니까?
나는 사무실 상호 운용성 단어를 사용하고 여기에 내가 지금 사용하는 코드입니다 : 당신이 직접 특정 HTML 태그를 사용하도록 말할 수
Microsoft.Office.Interop.Word.Application app = new Microsoft.Office.Interop.Word.Application();
Document doc = app.Documents.Open(FileName: @"C:\Users\example\Documents\Template.docx", ReadOnly: false);
app.Selection.Find.Execute("<Index>");
app.Selection.TypeText("<h1>hello</h1>");
doc.SaveAs2(@"C:\Users\krisb\Documents\voorbeeld.html", FileFormat: WdSaveFormat.wdFormatWebArchive);
doc.Close();
Document doc1 = app.Documents.Open(FileName: @"C:\Users\example\Documents\voorbeeld.html", ReadOnly: false);
app.Selection.Find.Execute("<");
app.Selection.TypeText("<");
app.Selection.Find.Execute(">");
app.Selection.TypeText(">");
doc1.SaveAs2(@"C:\Users\example\Documents\template.docx", FileFormat: WdSaveFormat.wdFormatDocumentDefault);
doc1.Close();
Document doc2 = app.Documents.Open(FileName: @"C:\Users\example\Documents\kristemplate.docx", ReadOnly: false);
doc2.SaveAs2(@"C:\Users\example\Documents\kristemplate.pdf", FileFormat: WdSaveFormat.wdFormatPDF);
app.Quit();`
_ "<를 <와"? – SeM
아니요, html 파일을 html 파일에 넣으면 << –
으로 바꿉니다. 그런 다음 해당 부분에서 질문을 수정하십시오. – SeM