필드 제거
Contents
[
Hide
]
문서에서 필드를 제거해야 하는 경우도 있습니다. 이는 다른 필드 유형으로 대체되거나 해당 필드가 문서에 더 이상 필요하지 않은 경우 발생할 수 있습니다. 예를 들어 HTML로 저장할 때 TOC
필드입니다.
DocumentBuilder.insert_field를 사용하여 문서에 삽입된 필드를 제거하려면 문서에서 필드를 쉽게 제거할 수 있는 편리한 remove 방법을 제공하는 반환된 Field 객체를 사용하세요.
다음 코드 예제에서는 문서에서 필드를 제거하는 방법을 보여줍니다
This file contains hidden or 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-Python-via-.NET | |
doc = aw.Document(docs_base.my_dir + "Various fields.docx") | |
field = doc.range.fields[0] | |
field.remove() |
Aspose.Words GitHub에서 이 예제의 샘플 파일을 다운로드할 수 있습니다.