Aspose::Words::Fields::FormFieldCollection Class Reference

A collection of FormField objects that represent all the form fields in a range. More...

#include "Aspose.Words.Cpp/Model/Fields/FormFields/FormFieldCollection.h"

Inherits IEnumerable< System::SharedPtr< Aspose::Words::Fields::FormField > >.

Public Member Functions

int32_t get_Count ()
 Returns the number of form fields in the collection. More...
 
System::SharedPtr< Aspose::Words::Fields::FormFieldidx_get (int32_t index)
 Returns a form field at the specified index. More...
 
System::SharedPtr< Aspose::Words::Fields::FormFieldidx_get (System::String bookmarkName)
 Returns a form field by bookmark name. More...
 
void Remove (System::String formField)
 Removes a form field with the specified name. More...
 
void RemoveAt (int32_t index)
 Removes a form field at the specified index. More...
 
void Clear ()
 Removes all form fields from this collection and from the document. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< Aspose::Words::Fields::FormField > > > GetEnumerator ()
 Returns an enumerator object. More...
 

Detailed Description

A collection of FormField objects that represent all the form fields in a range.

Member Function Documentation

◆ Clear()

void Aspose::Words::Fields::FormFieldCollection::Clear ( )

Removes all form fields from this collection and from the document.

◆ get_Count()

int32_t Aspose::Words::Fields::FormFieldCollection::get_Count ( )

Returns the number of form fields in the collection.

◆ GetEnumerator()

System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<Aspose::Words::Fields::FormField> > > Aspose::Words::Fields::FormFieldCollection::GetEnumerator ( )

Returns an enumerator object.

◆ idx_get() [1/2]

System::SharedPtr<Aspose::Words::Fields::FormField> Aspose::Words::Fields::FormFieldCollection::idx_get ( int32_t  index)

Returns a form field at the specified index.

The index is zero-based.

Negative indexes are allowed and indicate access from the back of the collection. For example -1 means the last item, -2 means the second before last and so on.

If index is greater than or equal to the number of items in the list, this returns a null reference.

If index is negative and its absolute value is greater than the number of items in the list, this returns a null reference.

Parameters
indexAn index into the collection.

◆ idx_get() [2/2]

System::SharedPtr<Aspose::Words::Fields::FormField> Aspose::Words::Fields::FormFieldCollection::idx_get ( System::String  bookmarkName)

Returns a form field by bookmark name.

Returns null if the form field with the specified bookmark name cannot be found.

Parameters
bookmarkNameCase-insensitive bookmark name.

◆ Remove()

void Aspose::Words::Fields::FormFieldCollection::Remove ( System::String  formField)

Removes a form field with the specified name.

If there is a bookmark associated with the form field, the bookmark is not removed.

Parameters
formFieldThe case-insensitive name of the form field to remove.

◆ RemoveAt()

void Aspose::Words::Fields::FormFieldCollection::RemoveAt ( int32_t  index)

Removes a form field at the specified index.

If there is a bookmark associated with the form field, the bookmark is not removed.

Parameters
indexThe zero-based index of the form field to remove.