필드 속성 찾기
Contents
[
Hide
]
다음을 사용하여 삽입되는 필드 DocumentBuilder.InsertField 반환 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-C | |
auto doc = MakeObject<Document>(MyDir + "Hyperlinks.docx"); | |
for(const auto& field : doc->get_Range()->get_Fields()) | |
{ | |
auto fieldCode = field->GetFieldCode(); | |
auto fieldResult = field->get_Result(); | |
} |
참고 문서에서 병합 필드의 이름만 찾는 경우 기본 제공 대신 사용할 수 있습니다 GetFieldNames 방법
다음 코드 예제에서는 문서에서 모든 병합 필드의 이름을 가져오는 방법을 보여 줍니다:
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>(); | |
ArrayPtr<String> fieldNames = doc->get_MailMerge()->GetFieldNames(); |