Aspose::Words::Fields::FieldCreateDate Class Reference

Detailed Description

Implements the CREATEDATE field.

Examples

Shows how to use the CREATEDATE field to display the creation date/time of the document.

auto doc = MakeObject<Document>(MyDir + u"Document.docx");
auto builder = MakeObject<DocumentBuilder>(doc);
builder->MoveToDocumentEnd();
builder->Writeln(u" Date this document was created:");
// We can use the CREATEDATE field to display the date and time of the creation of the document.
// Below are three different calendar types according to which the CREATEDATE field can display the date/time.
// 1 - Islamic Lunar Calendar:
builder->Write(u"According to the Lunar Calendar - ");
auto field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseLunarCalendar(true);
ASSERT_EQ(u" CREATEDATE \\h", field->GetFieldCode());
// 2 - Umm al-Qura calendar:
builder->Write(u"\nAccording to the Umm al-Qura Calendar - ");
field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseUmAlQuraCalendar(true);
ASSERT_EQ(u" CREATEDATE \\u", field->GetFieldCode());
// 3 - Indian National Calendar:
builder->Write(u"\nAccording to the Indian National Calendar - ");
field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseSakaEraCalendar(true);
ASSERT_EQ(u" CREATEDATE \\s", field->GetFieldCode());
doc->UpdateFields();
doc->Save(ArtifactsDir + u"Field.CREATEDATE.docx");

#include <Aspose.Words.Cpp/Fields/FieldCreateDate.h>

+ Inheritance diagram for Aspose::Words::Fields::FieldCreateDate:

Public Member Functions

bool get_UseLunarCalendar ()
 Gets or sets whether to use the Hijri Lunar or Hebrew Lunar calendar. More...
 
bool get_UseSakaEraCalendar ()
 Gets or sets whether to use the Saka Era calendar. More...
 
bool get_UseUmAlQuraCalendar ()
 Gets or sets whether to use the Um-al-Qura calendar. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_UseLunarCalendar (bool value)
 Setter for get_UseLunarCalendar. More...
 
void set_UseSakaEraCalendar (bool value)
 Setter for get_UseSakaEraCalendar. More...
 
void set_UseUmAlQuraCalendar (bool value)
 Setter for get_UseUmAlQuraCalendar. More...
 
- Public Member Functions inherited from Field
String get_DisplayResult ()
 Gets the text that represents the displayed field result. More...
 
SharedPtr< FieldEndget_End () const
 Gets the node that represents the field end. More...
 
SharedPtr< FieldEndget_FieldEnd () const
 Gets the node that represents the field end. More...
 
SharedPtr< FieldStartget_FieldStart () const
 Gets the node that represents the start of the field. More...
 
SharedPtr< FieldFormatget_Format ()
 Gets a FieldFormat object that provides typed access to field's formatting. More...
 
bool get_IsDirty ()
 Gets or sets whether the current result of the field is no longer correct (stale) due to other modifications made to the document. More...
 
bool get_IsLocked ()
 Gets or sets whether the field is locked (should not recalculate its result). More...
 
int32_t get_LocaleId ()
 Gets or sets the LCID of the field. More...
 
String get_Result ()
 Gets or sets text that is between the field separator and field end. More...
 
SharedPtr< FieldSeparatorget_Separator ()
 Gets the node that represents the field separator. Can be null. More...
 
SharedPtr< FieldStartget_Start () const
 Gets the node that represents the start of the field. More...
 
virtual FieldType get_Type () const
 Gets the Microsoft Word field type. More...
 
String GetFieldCode ()
 Returns text between field start and field separator (or field end if there is no separator). Both field code and field result of child fields are included. More...
 
String GetFieldCode (bool includeChildFieldCodes)
 Returns text between field start and field separator (or field end if there is no separator). More...
 
SharedPtr< NodeRemove ()
 Removes the field from the document. Returns a node right after the field. If the field's end is the last child of its parent node, returns its parent paragraph. If the field is already removed, returns null. More...
 
void set_IsDirty (bool value)
 Setter for get_IsDirty. More...
 
void set_IsLocked (bool value)
 Setter for get_IsLocked. More...
 
void set_LocaleId (int32_t value)
 Setter for get_LocaleId. More...
 
void set_Result (const String &value)
 Setter for get_Result. More...
 
bool Unlink ()
 Performs the field unlink. More...
 
void Update ()
 Performs the field update. Throws if the field is being updated already. More...
 
void Update (bool ignoreMergeFormat)
 Performs a field update. Throws if the field is being updated already. More...
 

Static Public Member Functions

static const TypeInfoType ()
 
- Static Public Member Functions inherited from Field
static const TypeInfoType ()
 

Member Function Documentation

◆ get_UseLunarCalendar()

bool Aspose::Words::Fields::FieldCreateDate::get_UseLunarCalendar ( )

Gets or sets whether to use the Hijri Lunar or Hebrew Lunar calendar.

Examples

Shows how to use the CREATEDATE field to display the creation date/time of the document.

auto doc = MakeObject<Document>(MyDir + u"Document.docx");
auto builder = MakeObject<DocumentBuilder>(doc);
builder->MoveToDocumentEnd();
builder->Writeln(u" Date this document was created:");
// We can use the CREATEDATE field to display the date and time of the creation of the document.
// Below are three different calendar types according to which the CREATEDATE field can display the date/time.
// 1 - Islamic Lunar Calendar:
builder->Write(u"According to the Lunar Calendar - ");
auto field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseLunarCalendar(true);
ASSERT_EQ(u" CREATEDATE \\h", field->GetFieldCode());
// 2 - Umm al-Qura calendar:
builder->Write(u"\nAccording to the Umm al-Qura Calendar - ");
field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseUmAlQuraCalendar(true);
ASSERT_EQ(u" CREATEDATE \\u", field->GetFieldCode());
// 3 - Indian National Calendar:
builder->Write(u"\nAccording to the Indian National Calendar - ");
field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseSakaEraCalendar(true);
ASSERT_EQ(u" CREATEDATE \\s", field->GetFieldCode());
doc->UpdateFields();
doc->Save(ArtifactsDir + u"Field.CREATEDATE.docx");

◆ get_UseSakaEraCalendar()

bool Aspose::Words::Fields::FieldCreateDate::get_UseSakaEraCalendar ( )

Gets or sets whether to use the Saka Era calendar.

Examples

Shows how to use the CREATEDATE field to display the creation date/time of the document.

auto doc = MakeObject<Document>(MyDir + u"Document.docx");
auto builder = MakeObject<DocumentBuilder>(doc);
builder->MoveToDocumentEnd();
builder->Writeln(u" Date this document was created:");
// We can use the CREATEDATE field to display the date and time of the creation of the document.
// Below are three different calendar types according to which the CREATEDATE field can display the date/time.
// 1 - Islamic Lunar Calendar:
builder->Write(u"According to the Lunar Calendar - ");
auto field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseLunarCalendar(true);
ASSERT_EQ(u" CREATEDATE \\h", field->GetFieldCode());
// 2 - Umm al-Qura calendar:
builder->Write(u"\nAccording to the Umm al-Qura Calendar - ");
field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseUmAlQuraCalendar(true);
ASSERT_EQ(u" CREATEDATE \\u", field->GetFieldCode());
// 3 - Indian National Calendar:
builder->Write(u"\nAccording to the Indian National Calendar - ");
field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseSakaEraCalendar(true);
ASSERT_EQ(u" CREATEDATE \\s", field->GetFieldCode());
doc->UpdateFields();
doc->Save(ArtifactsDir + u"Field.CREATEDATE.docx");

◆ get_UseUmAlQuraCalendar()

bool Aspose::Words::Fields::FieldCreateDate::get_UseUmAlQuraCalendar ( )

Gets or sets whether to use the Um-al-Qura calendar.

Examples

Shows how to use the CREATEDATE field to display the creation date/time of the document.

auto doc = MakeObject<Document>(MyDir + u"Document.docx");
auto builder = MakeObject<DocumentBuilder>(doc);
builder->MoveToDocumentEnd();
builder->Writeln(u" Date this document was created:");
// We can use the CREATEDATE field to display the date and time of the creation of the document.
// Below are three different calendar types according to which the CREATEDATE field can display the date/time.
// 1 - Islamic Lunar Calendar:
builder->Write(u"According to the Lunar Calendar - ");
auto field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseLunarCalendar(true);
ASSERT_EQ(u" CREATEDATE \\h", field->GetFieldCode());
// 2 - Umm al-Qura calendar:
builder->Write(u"\nAccording to the Umm al-Qura Calendar - ");
field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseUmAlQuraCalendar(true);
ASSERT_EQ(u" CREATEDATE \\u", field->GetFieldCode());
// 3 - Indian National Calendar:
builder->Write(u"\nAccording to the Indian National Calendar - ");
field = System::DynamicCast<FieldCreateDate>(builder->InsertField(FieldType::FieldCreateDate, true));
field->set_UseSakaEraCalendar(true);
ASSERT_EQ(u" CREATEDATE \\s", field->GetFieldCode());
doc->UpdateFields();
doc->Save(ArtifactsDir + u"Field.CREATEDATE.docx");

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::Fields::FieldCreateDate::GetType ( ) const
overridevirtual

Reimplemented from Aspose::Words::Fields::Field.

◆ Is()

virtual bool Aspose::Words::Fields::FieldCreateDate::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from Aspose::Words::Fields::Field.

◆ set_UseLunarCalendar()

void Aspose::Words::Fields::FieldCreateDate::set_UseLunarCalendar ( bool  value)

◆ set_UseSakaEraCalendar()

void Aspose::Words::Fields::FieldCreateDate::set_UseSakaEraCalendar ( bool  value)

◆ set_UseUmAlQuraCalendar()

void Aspose::Words::Fields::FieldCreateDate::set_UseUmAlQuraCalendar ( bool  value)

◆ Type()

static const System::TypeInfo& Aspose::Words::Fields::FieldCreateDate::Type ( )
static