0
두 섹션 나누기 사이에서 문서의 내용을 바꾸려면 엄청난 양의 Word 문서를 처리해야합니다.섹션 나누기 사이에 내용 바꾸기
기본적으로 문서가 같은 구조는 다음과 같다 이미 문서
using (WordprocessingDocument myDoc = WordprocessingDocument.Open(filename, true))
{
MainDocumentPart mainPart = myDoc.MainDocumentPart;
List<Break> breaks = mainPart.Document.Descendants<Break>().ToList();
// TODO replace content between the breaks
mainPart.Document.Save();
}
에 휴식을 감지하는 방법을 알고하지만 사이의 내용을 교체하는 방법을 모르는
Content
========= Continuous Section Break ==========
Content with 2 columns
========= Continuous Section Break ==========
Content
그들.
감사합니다.
MS Word에서는 각 섹션을 개별적으로 조작 할 수있는 섹션 수집이 있습니다. 'Sections'에는 텍스트 범위를 참조하는'.Range property'가 있습니다. 이 도움말을 시도해보십시오. –
@ KazJaw 감사합니다.하지만 VBA가 아닌 Open XML SDK를 사용하고 있습니다. –