Main Content

mlreportgen.ppt.MessageEventData Class

Namespace: mlreportgen.ppt

Holds message triggering message event

Description

Contains the message that triggered a message event.

The mlreportgen.ppt.MessageEventData class is a handle class.

Creation

Description

example

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.

Properties

expand all

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

Attributes:

NonCopyable
true

Data Types: char | string

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 or string scalar. A session-unique tag is generated as part of the creation of this object. 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.

Specifying your own tag value can help you to identify where issues occur during presentation generation.

Attributes:

NonCopyable
true

Data Types: char | string

Examples

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);

open(pre);

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

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

close(pre);

Version History

Introduced in R2015a