MapiMessage.getFileNo Method [AX 2012]

Gets a file attachment from a message.

public MapiFileDesc getFileNo(int fileNo)

Run On

Called

Parameters

fileNo
Type: int
The index of the attachment to retrieve. The index starts at 1, and the total number of attachments can be retrieved using the numFiles method.

Return Value

Type: MapiFileDesc Class
Returns a MapiFileDesc object that contains information about the attachment.

The attached file is returned in a MapiFileDesc object.

{ 
    MapiFileDesc attachment; 
    MapiMessage message; 
  
    // Retrieve message. 
    // ...  
 
    if (message.NumFiles() >= 1) 
    { 
        attachment = message.GetFileNo(1); 
    } 
}

Community Additions

ADD
Show: