MapiMessage.setFileNo Method [AX 2012]

Sets a file attachment for the message.

public void setFileNo(int fileNo, MapiFileDesc file)

Run On

Called

Parameters

fileNo
Type: int
The index of the attachment.
file
Type: MapiFileDesc Class
The MapiFileDesc object that describes the attachment.

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.

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

Community Additions

ADD
Show: