Main Content

dispatch

Class: mlreportgen.ppt.MessageDispatcher
Namespace: mlreportgen.ppt

Dispatch PPT status message

Description

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

example

Examples

expand 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

expand 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

Version History

Introduced in R2015b