Filter löschen
Filter löschen

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

14 Ansichten (letzte 30 Tage)
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';

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Report Generator finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by