This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mlreportgen.ppt.MessageEventData class

Package: mlreportgen.ppt

Holds message triggering message event


Contains the message that triggered a message event.


messageEventDataObj = MessageEventData(msg) creates a message event data object that contains a PPT message, such as a message of type mlreportgen.ppt.ProgressMessage.

The PPT message dispatcher attaches an object of this type to a message event when it dispatches a message. Attaching the object enables message event listeners to retrieve the dispatched message. You need to create instances of this type only if you want to create your own message dispatcher.

Input Arguments

expand all

A message object, such as an mlreportgen.ppt.ProgressMessage object, that triggers a message event.

Output Arguments

expand all

Container for message that triggers a message event, returned as an mlreportgen.ppt.MessageEventData object.


expand all

ID for PPT API object, specified as a character vector. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.

The value of this read-only property is a PPT message object, such as an mlreportgen.ppt.ProgressMessage object, that triggers a message event.

Tag for this PPT API object, specified as a character vector. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object.

An example of a reason for specifying your own tag value is to make it easier to identify where an issue occurred during presentation generation.


collapse all

When you add a dispatcher, the PPT API creates the evtdata object, which is an mlreportgen.ppt.MessageEventData object.

Create the presentation.

import mlreportgen.ppt.*;
pre = Presentation('myPresentation.pptx');

Create the listener and add it to the message dispatcher.

dispatcher = MessageDispatcher.getTheDispatcher;

dispatcher.Filter.ErrorMessagesPass = true;
dispatcher.Filter.ProgressMessagesPass = false;

l = addlistener(dispatcher,'Message', ...
@(src, evtdata) disp(evtdata.Message.formatAsText));

Create the message and dispatch it. Then open the presentation.

msg = ErrorMessage('Invalid slide',pre);
dispatch(dispatcher, msg);


Create an error in the program and dispatch the message before opening.

titleText = Text('This is a Title');
titleText.Style = {Bold};