Aspose::Words::MailMerging::ImageFieldMergingArgs Class Reference

Detailed Description

Provides data for the ImageFieldMerging() event.

This event occurs during mail merge when an image mail merge field is encountered in the document. You can respond to this event to return a file name, stream, or an Image object to the mail merge engine so it is inserted into the document.

There are three properties available ImageFileName, ImageStream and Image to specify where the image must be taken from. Set only one of these properties.

To insert an image mail merge field into a document in Word, select Insert/Field command, then select MergeField and type Image:MyFieldName.

See also
Aspose::Words::MailMerging::IFieldMergingCallback

#include <Aspose.Words.Cpp/MailMerging/ImageFieldMergingArgs.h>

+ Inheritance diagram for Aspose::Words::MailMerging::ImageFieldMergingArgs:

Public Member Functions

SharedPtr< Imageget_Image () const
 Specifies the image that the mail merge engine must insert into the document. More...
 
String get_ImageFileName () const
 Sets the file name of the image that the mail merge engine must insert into the document. More...
 
SharedPtr< MergeFieldImageDimensionget_ImageHeight () const
 Specifies the image height for the image to insert into the document. More...
 
SharedPtr< Streamget_ImageStream () const
 Specifies the stream for the mail merge engine to read an image from. More...
 
SharedPtr< MergeFieldImageDimensionget_ImageWidth () const
 Specifies the image width for the image to insert into the document. More...
 
SharedPtr< Shapeget_Shape () const
 Specifies the shape that the mail merge engine must insert into the document. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_Image (SharedPtr< Image > value)
 Specifies the image that the mail merge engine must insert into the document. More...
 
void set_ImageFileName (String value)
 Sets the file name of the image that the mail merge engine must insert into the document. More...
 
void set_ImageHeight (SharedPtr< MergeFieldImageDimension > value)
 Setter for get_ImageHeight. More...
 
void set_ImageStream (SharedPtr< Stream > value)
 Specifies the stream for the mail merge engine to read an image from. More...
 
void set_ImageWidth (SharedPtr< MergeFieldImageDimension > value)
 Setter for get_ImageWidth. More...
 
void set_Shape (SharedPtr< Shape > value)
 Setter for get_Shape. More...
 
- Public Member Functions inherited from FieldMergingArgsBase
SharedPtr< Documentget_Document () const
 Returns the Document object for which the mail merge is performed. More...
 
String get_DocumentFieldName () const
 Gets the name of the merge field as specified in the document. More...
 
SharedPtr< FieldMergeFieldget_Field () const
 Gets the object that represents the current merge field. More...
 
String get_FieldName () const
 Gets the name of the merge field in the data source. More...
 
SharedPtr< Objectget_FieldValue () const
 Gets the value of the field from the data source. More...
 
int32_t get_RecordIndex () const
 Gets the zero based index of the record that is being merged. More...
 
String get_TableName () const
 Gets the name of the data table for the current merge operation or empty string if the name is not available. More...
 
void set_FieldValue (SharedPtr< Object > value)
 Sets the value of the field from the data source. More...
 

Static Public Member Functions

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

Member Function Documentation

◆ get_Image()

System::SharedPtr<System::Drawing::Image> Aspose::Words::MailMerging::ImageFieldMergingArgs::get_Image ( ) const

Specifies the image that the mail merge engine must insert into the document.

◆ get_ImageFileName()

System::String Aspose::Words::MailMerging::ImageFieldMergingArgs::get_ImageFileName ( ) const

Sets the file name of the image that the mail merge engine must insert into the document.

◆ get_ImageHeight()

System::SharedPtr<Aspose::Words::Fields::MergeFieldImageDimension> Aspose::Words::MailMerging::ImageFieldMergingArgs::get_ImageHeight ( ) const

Specifies the image height for the image to insert into the document.

The value of this property initially comes from the corresponding MERGEFIELD's code, contained in the template document. To override the initial value, you should assign an instance of MergeFieldImageDimension class to this property or set the properties for the instance of MergeFieldImageDimension class, returned by this property.

To indicate that the original value of the image height should be applied, you should assign the null value to this property or set the Value property for the instance of MergeFieldImageDimension class, returned by this property, to a negative value.

See also
Aspose::Words::Fields::MergeFieldImageDimension
Aspose::Words::Fields::MergeFieldImageDimensionUnit

◆ get_ImageStream()

System::SharedPtr<System::IO::Stream> Aspose::Words::MailMerging::ImageFieldMergingArgs::get_ImageStream ( ) const

Specifies the stream for the mail merge engine to read an image from.

Aspose.Words closes this stream after it merges the image into the document.

◆ get_ImageWidth()

System::SharedPtr<Aspose::Words::Fields::MergeFieldImageDimension> Aspose::Words::MailMerging::ImageFieldMergingArgs::get_ImageWidth ( ) const

Specifies the image width for the image to insert into the document.

The value of this property initially comes from the corresponding MERGEFIELD's code, contained in the template document. To override the initial value, you should assign an instance of MergeFieldImageDimension class to this property or set the properties for the instance of MergeFieldImageDimension class, returned by this property.

To indicate that the original value of the image width should be applied, you should assign the null value to this property or set the Value property for the instance of MergeFieldImageDimension class, returned by this property, to a negative value.

See also
Aspose::Words::Fields::MergeFieldImageDimension
Aspose::Words::Fields::MergeFieldImageDimensionUnit

◆ get_Shape()

System::SharedPtr<Aspose::Words::Drawing::Shape> Aspose::Words::MailMerging::ImageFieldMergingArgs::get_Shape ( ) const

Specifies the shape that the mail merge engine must insert into the document.

When this property is specified, the mail merge engine ignores all other properties like ImageFileName or ImageStream and simply inserts the shape into the document.

Use this property to fully control the process of merging an image merge field. For example, you can specify WrapType or any other shape property to fine tune the resulting node. However, please note that you are responsible for providing the content of the shape.

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::MailMerging::ImageFieldMergingArgs::GetType ( ) const
overridevirtual

◆ Is()

virtual bool Aspose::Words::MailMerging::ImageFieldMergingArgs::Is ( const System::TypeInfo target) const
overridevirtual

◆ set_Image()

void Aspose::Words::MailMerging::ImageFieldMergingArgs::set_Image ( System::SharedPtr< System::Drawing::Image value)

Specifies the image that the mail merge engine must insert into the document.

◆ set_ImageFileName()

void Aspose::Words::MailMerging::ImageFieldMergingArgs::set_ImageFileName ( System::String  value)

Sets the file name of the image that the mail merge engine must insert into the document.

◆ set_ImageHeight()

void Aspose::Words::MailMerging::ImageFieldMergingArgs::set_ImageHeight ( System::SharedPtr< Aspose::Words::Fields::MergeFieldImageDimension value)

◆ set_ImageStream()

void Aspose::Words::MailMerging::ImageFieldMergingArgs::set_ImageStream ( System::SharedPtr< System::IO::Stream value)

Specifies the stream for the mail merge engine to read an image from.

Aspose.Words closes this stream after it merges the image into the document.

◆ set_ImageWidth()

void Aspose::Words::MailMerging::ImageFieldMergingArgs::set_ImageWidth ( System::SharedPtr< Aspose::Words::Fields::MergeFieldImageDimension value)

◆ set_Shape()

void Aspose::Words::MailMerging::ImageFieldMergingArgs::set_Shape ( System::SharedPtr< Aspose::Words::Drawing::Shape value)

◆ Type()

static const System::TypeInfo& Aspose::Words::MailMerging::ImageFieldMergingArgs::Type ( )
static