MailMergedPresentationHandler

MailMergedPresentationHandler delegate

Represents the method that receives each presentation created by MergeToMultiplePresentations. The handler is called once for every data set, after the presentation is filled with its data.

public delegate void MailMergedPresentationHandler(IPresentation presentation, 
    IMailMergedPresentationArgs args);
ParameterTypeDescription
presentationIPresentationThe presentation created from the template and filled with the data of the current data set.
argsIMailMergedPresentationArgsInformation about the presentation: the index and the data set it was created from.

Remarks

The presentation is owned by the mail merge and is disposed as soon as the handler returns. Save it or copy the required data inside the handler. Do not keep a reference to the presentation after the handler returns and do not dispose it.

The handler is called on the calling thread, one presentation at a time, in the order of the data sets in the data source. Only one created presentation is kept in memory at a time.

An exception thrown by the handler stops the mail merge and is passed to the caller unchanged. The presentations already passed to the handler are not affected; the remaining data sets are not processed.

See Also