Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.ppt.MessageEventData class

Package: mlreportgen.ppt
Superclasses:

Holds message triggering message event

Description

Contains the message that triggered a message event.

Construction

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.

Properties

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.

Examples

expand 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);
Was this topic helpful?