Change of the width of the Column of tables in PowerPoint from MATLAB using ActiveX

3 visualizaciones (últimos 30 días)
Using ActiveX, I added a table to PowerPoint.
Please tell me the method to change the width of the column that I appointed.
Here is the code I have so far:
PowerPoint = actxserver('PowerPoint.Application');
PowerPoint.Visible = 1;
Presentation = PowerPoint.Presentations.Open( fullfile(pwd,'PPT_Template.pptx')) ; % open File
No=7; % Add LayoutNo
t_NewLayout = Presentation.SlideMaster.CustomLayouts.Item(No);
i_Page = 1;
t_Slide = Presentation.Slides.AddSlide( i_Page, t_NewLayout ); % add Slide
posX = 200;
posY = 80;
tableW = 300;
tableH = 400;
table = invoke(t_Slide.Shapes, 'AddTable', 4, 4, posX, posY, tableW, tableH); % create Table
table.Table.Cell(1,1).Shape.TextFrame.TextRange.Text = 'items'; % add text
table.Table.Cell(1,2).Shape.TextFrame.TextRange.Text = 'data1';
table.Table.Cell(1,3).Shape.TextFrame.TextRange.Text = 'data2';
table.Table.Cell(1,4).Shape.TextFrame.TextRange.Text = 'data3';

Respuesta aceptada

Satoshi Furukawa
Satoshi Furukawa el 22 de Abr. de 2021
I got it running with
t_table.Table.Columns.Item(i).Width = 120;
Where Item(i) denotes the ith column.

Más respuestas (0)

Categorías

Más información sobre MATLAB Report Generator en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by