---
title: "ابحث عن خصائص الحقل في Python"
---


يقوم الحقل الذي يتم إدراجه باستخدام [DocumentBuilder](https://reference.aspose.com/words/python-net/aspose.words/documentbuilder/).[insert_field](https://reference.aspose.com/words/python-net/aspose.words/documentbuilder/insert_field/) بإرجاع كائن [Field](https://reference.aspose.com/words/python-net/aspose.words.fields/field/). هذه فئة واجهة توفر طرقًا مفيدة للعثور بسرعة على بعض خصائص الحقل.

يوضح مثال التعليمات البرمجية التالي كيفية العثور على رمز الحقل ونتيجة الحقل:

{{< gist "aspose-words-gists" "e9d8f984dac599756ccb4a64b8c79768" "Examples-DocsExamples-DocsExamples-Programming with Documents-working_with_fields-GetFieldCode.py" >}}

لاحظ أنه إذا كنت تبحث فقط عن أسماء حقول الدمج في مستند ما، فيمكنك بدلاً من ذلك استخدام طريقة [get_field_names](https://reference.aspose.com/words/python-net/aspose.words.mailmerging/mailmerge/get_field_names/) المضمنة.

يوضح مثال التعليمات البرمجية التالي كيفية الحصول على أسماء كافة حقول الدمج في مستند:

{{< gist "aspose-words-gists" "e9d8f984dac599756ccb4a64b8c79768" "Examples-DocsExamples-DocsExamples-Programming with Documents-working_with_fields-GetFieldNames.py" >}}
