mlreportgen.ppt.MessageDispatcher.dispatch

Package: mlreportgen.ppt

Dispatch PPT status message

Syntax

dispatch(dispatcher,message)

Description

example

dispatch(dispatcher,message) dispatches a PPT status message.

Examples

collapse all

This example shows how to add a progress message to display when generating a report.

Add a dispatcher and listener to the presentation.

import mlreportgen.ppt.*;
pre = Presentation('myPresentation.pptx');
     
dispatcher = MessageDispatcher.getTheDispatcher;
l = addlistener(dispatcher,'Message', ...
      @(src, evtdata) disp(evtdata.Message.formatAsText));
     
dispatch(dispatcher,ErrorMessage('invalid slide',pre));
open(pre);
     
titleText = Text('This is a Title');
titleText.Style = {Bold};

replace(pre,'Title',titleText);
     
close(pre);
     
delete(l);

Check the progress messages in the MATLAB® Command Window. The starting chapter message appears, in addition to the predefined PPT progress messages.

Input Arguments

collapse all

PPT message dispatcher, specified as an mlreportgen.ppt.MessageDispatcher object.

Message to dispatch, specified as a PPT message object. Use one of these types of PPT message objects:

  • mlreportgen.ppt.ProgressMessage

  • mlreportgen.ppt.WarningMessage

  • mlreportgen.ppt.ErrorMessage

  • mlreportgen.ppt.DebugMessage

Introduced in R2015b