필드 제거
Contents
[
Hide
]
문서에서 필드를 제거해야 하는 경우가 있습니다. 이는 다른 필드 유형으로 바꿔야 하거나 해당 필드가 문서에 더 이상 필요하지 않은 경우 발생할 수 있습니다. 예를 들어 HTML로 저장할 때 TOC
필드입니다.
DocumentBuilder.InsertField를 사용하여 문서에 삽입된 필드를 제거하려면 문서에서 필드를 쉽게 제거할 수 있는 편리한 Remove 방법을 제공하는 반환된 Field 객체를 사용하십시오.
다음 코드 예제에서는 문서에서 필드를 제거하는 방법을 보여줍니다
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET | |
Document doc = new Document(MyDir + "Various fields.docx"); | |
Field field = doc.Range.Fields[0]; | |
field.Remove(); |
Aspose.Words GitHub에서 이 예제의 샘플 파일을 다운로드할 수 있습니다.