MATLAB Answers

Interfacing between MATLAB and PowerPoint through Visual Basic or VBA macros to group shapes in VBA

조회 수: 9(최근 30일)
Murugaiyan
Murugaiyan 11 Feb 2011
답변: gonzalo Mier 11 Oct 2018
This is a bit of code to give an idea
a = actxserver('PowerPoint.Application');%invoking server
a.Visible = 1;
Presentations = a.Presentations;
Presentation = invoke(Presentations,'Open','.....')%path
n_slide = invoke(Presentation.Slides,'Add',1,11);%adding a slide and some shapes
a1=new_slide.Shapes.AddShape('msoshaperectangle',125,470,25,25);
a2=new_slide.Shapes.AddShape('msoshapeoval',200,200,67,60);
With this I can get the names of shapes in MATLAB
a1.Name,a2.Name
Now I what to pass these names as arguments to VBA in PowerPoint to a subroutine so that by macro creation I can group it in VBA itself.
The problem I'm facing is how would I pass these names to VBA, i.e. argument types.

  댓글 수: 0

댓글을 달려면 로그인하십시오.

답변(1개)

gonzalo Mier
gonzalo Mier 11 Oct 2018
You always can make an array with the names to have a known type: [a1.Name,a2.Name]

  댓글 수: 0

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by