필드 제거
Contents
[
Hide
]
때때로 문서에서 필드를 제거해야 합니다. 다른 필드 유형으로 대체해야 하거나 문서에서 필드가 더 이상 필요하지 않을 때 이 문제가 발생할 수 있습니다. 예를 들어 TOC
에 저장할 때 필드 HTML.
다음을 사용하여 문서에 삽입된 필드를 제거하려면 DocumentBuilder.InsertField,반환 된 사용 Field 편리한 것을 제공하는 목표, Remove 쉽게 문서에서 필드를 제거하는 방법.
다음 코드 예제에서는 문서에서 필드를 제거하는 방법을 보여 줍니다:
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-C | |
auto doc = MakeObject<Document>(MyDir + u"Various fields.docx"); | |
SharedPtr<Field> field = doc->get_Range()->get_Fields()->idx_get(0); | |
field->Remove(); |