|
"Tannistha " <unculturedperson@gmail.com> wrote in message <iddh40$qm9$1@fred.mathworks.com>...
> Hi all, i am using MATLAB 2009b and i have MS Office2003. i am running through some problem while trying to open an exisiting ppt presentation and/or adding slides to new presentation
> if i use this code:
>
> ppt = actxserver('powerpoint.application');
> ppt.Visible = 1;
> >> ppt.Presentations.Open('Mytest.ppt');
> comes error, the file is in the current MATLAB directory
> ??? Invoke Error, Dispatch Exception:
> Source: Microsoft Office PowerPoint 2003
> Description: PowerPoint could not open the file.
> Help File:
> Help Context ID: 0
> so i go to open a new presentation
> ppt.Presentations.Add()
> now if i type this
>
>
> Presentation.Slides.invoke
> ??? Undefined variable "Presentation" or class "Presentation.Slides.invoke".
>
> Slide1=Presentation.Slides.Add(1)
> ??? Undefined variable "Presentation" or class "Presentation.Slides.Add".
> i tried another way
>
> Slide1= ppt.ActivePresentation.Slides.AddSlide
> ??? No appropriate method or public field AddSlide for class
> Interface.Microsoft_PowerPoint_11.0_Object_Library.Slides.
>
> all these methods i found out from whatever help file, help codes available at MATLAB central, i am stuck at step 1 itself and so i dont know how i am going to add text, text+images to slide one
> can anyone with experience please help?
Try this instead, it worked for me with office 2003
clearppt='Test.ppt'
ppt = actxserver('PowerPoint.Application');
%open presentation
op = invoke(ppt.Presentations,'Open',clearppt);
|