AddAttachment method: IBInfo class
Syntax
AddAttachment(Path)
Description
Use the AddAttachment method to add an attachment to a message.
Parameters
| Parameter | Description |
|---|---|
|
Path |
Specify an absolute path, including the file name and type, as a string, of the file you want to attach to the message. |
Returns
A string containing a content ID, which can be used for accessing the attachment with other methods, such as DeleteAttachment or SetAttachmentProperty.
Example
The following example shows sending an attachment with an asynchronous message:
Local Message &MSG;
Local Rowset &FLIGHT_PROFILE;
Local String &Attachment_Id;
Local Boolean &Test;
Local IntBroker &IntBroker;
QE_FLIGHTDATA.QE_ACNUMBER.Value = QE_FLIGHTDATA.QE_ACNUMBER + 1;
&FLIGHT_PROFILE = GetLevel0();
&MSG = CreateMessage(Operation.ASYNC_RR);
&Attachment_Id = &MSG.IBInfo. AddAttachment("C:\\temp\\MyFile.txt");
&Test = &MSG.IBInfo.SetAttachmentProperty(&Attachment_Id, %Attachment_Encoding,⇒
"UTF-8");
&Test = &MSG.IBInfo.SetAttachmentProperty(&Attachment_Id, %Attachment_Base,⇒
"Standard");
&Test = &MSG.IBInfo.SetAttachmentProperty(&Attachment_Id, %Attachment_Disposition,⇒
"Pending");
&Test = &MSG.IBInfo.SetAttachmentProperty(&Attachment_Id, %Attachment_Language,⇒
"English");
&Test = &MSG.IBInfo.SetAttachmentProperty(&Attachment_Id, %Attachment_Description,⇒
"Parts data");
&MSG.CopyRowset(&FLIGHT_PROFILE);
&IntBroker = %IntBroker
&IntBroker.Publish(&MSG);