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

8 vues (au cours des 30 derniers jours)
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';

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Report Generator dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by