mlreportgen.ppt.VAlign class

Package: mlreportgen.ppt
Superclasses:

Vertical alignment of table entry content

Description

Vertical alignment of table entry content.

Construction

vAlignObj = VAlign() creates a vertical alignment object having the value 'top'.

vAlignObj = VAlign(value) creates a vertical alignment object having the specified value.

Input Arguments

expand all

Vertical alignment for table entry content, specified as one of these values:

  • 'top'

  • 'bottom'

  • 'middle'

  • 'topCentered'

  • 'middleCentered'

  • 'bottomCentered'

Output Arguments

expand all

Vertical alignment of table entry content, returned as an mlreportgen.ppt.VAlign 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.

Tag for document element, specified as a character vector.

A session-unique ID is generated as part of document element creation. The generated tag has the form CLASS:ID, where CLASS is the class of the element and ID is the value of the Id property of the object. You can specify a tag to replace the generated tag.

For example, to make it easier to identify where an issue occurred during document generation, you can specify your own tag value.

Vertical alignment of table entry content, specified as a character vector.

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*
slidesFile = 'myVAlign.pptx';
slides = Presentation(slidesFile);
slide1 = add(slides,'Title and Content');

Create a table using a cell array. Set the vertical alignment for each entry.

table1 = Table();
row1 = TableRow();
p1 = Paragraph('top');
r1e1 = TableEntry();
r1e1.Style = {VAlign('top'),FontSize('.5in')};
append(r1e1,p1);
append(row1,r1e1);

p2 = Paragraph('middle');
r1e2 = TableEntry();
r1e2.Style = {VAlign('middle')};
append(r1e2,p2);
append(row1,r1e2);

row2 = TableRow();
p3 = Paragraph('bottom');
r2e1 = TableEntry();
r2e1.Style = {VAlign('bottom')};
append(r2e1,p3);
append(row2,r2e1);

p4 = Paragraph('middle centered');
r2e2 = TableEntry();
r2e2.Style = {VAlign('middleCentered'),FontSize('.5in')};
append(r2e2,p4);
append(row2,r2e2);

append(table1,row1);
append(table1,row2);

Add the table to the slide, generate the presentation, and open the myVAlign presentation. (The winopen code works on Windows® platforms.)

replace(slide1,'Content',table1);
close(slides);

if ispc
    winopen(slidesFile);
end

Introduced in R2015b