---
title: "Trova le proprietà del campo in Python"
---

Un campo inserito utilizzando [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/) restituisce un oggetto [Field](https://reference.aspose.com/words/python-net/aspose.words.fields/field/). Questa è una classe di facciata che fornisce metodi utili per trovare rapidamente alcune proprietà di un campo.

L'esempio di codice seguente mostra come trovare il codice di campo e il risultato del campo:

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

Nota se stai cercando solo i nomi dei campi di unione in un documento, puoi invece utilizzare il metodo [get_field_names](https://reference.aspose.com/words/python-net/aspose.words.mailmerging/mailmerge/get_field_names/) integrato.

Il seguente esempio di codice mostra come ottenere i nomi di tutti i campi di unione in un documento:

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