Share via


MapiMessage.setFileNo(Int32, MapiFileDesc) Method

Definition

Sets a file attachment for the message.

public:
 virtual void setFileNo(int _fileNo, Dynamics::AX::Application::MapiFileDesc ^ _file);
public virtual void setFileNo (int _fileNo, Dynamics.AX.Application.MapiFileDesc _file);
abstract member setFileNo : int * Dynamics.AX.Application.MapiFileDesc -> unit
override this.setFileNo : int * Dynamics.AX.Application.MapiFileDesc -> unit
Public Overridable Sub setFileNo (_fileNo As Integer, _file As MapiFileDesc)

Parameters

_fileNo
Int32

The MapiFileDesc object that describes the attachment.

_file
MapiFileDesc

The MapiFileDesc object that describes the attachment.

Remarks

The attachments are numbered from 1. Therefore, the first attachment should be numbered 1. You can call the numFiles method to retrieve the number of attachments.

The following example demonstrates the setFileNo method.

{ 
    MapiMessage msg = new MapiMessage(); 
    MapiFileDesc attachment = new MapiFileDesc(); 
    attachment.Path("C:\\files\\info.txt"); 
    msg.SetFileNo(1,attachment); 
}

Applies to