ExchangeMessageWriter.CancelWrite

Syntax:

CancelWrite()

Description:

Interrupts message recording. The message is not considered to be sent. Exchange message writing can be completed by calling the EndWrite method, or by calling the CancelWrite method.
If writing has started and has not been completed in some manner before deleting the ExchangeMessageWriter object, the CancelWrite method is implicitly called before deletion. Similarly, if message writing has not been completed and the BeginWrite method has been called, the previous message write function is interrupted.

Availability:

Server, thick client, external connection, Mobile application (server).

Example:

RecordOfMessage = ExchangePlans.CreateMessageWriter();
XMLWriter = New XMLWriter;
XMLWriter.OpenFile(FileName);
RecordOfMessage.BeginWrite(XMLWriter, Recipient);
// Actions to write message body
If Failure Then
    RecordOfMessage.CancelWrite();
Else
    RecordOfMessage.EndWrite();
EndIf
;


    

1C:Enterprise Developer's Community