Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I want to add activex object on ppt using c#. My actual requirement is to access the properties of shockwaveflash object which are present inside the ppt on first slide and change properies(ex: movie, alignment, moviedata etc...) after then overright this ppt with existing one. Let me know if any solution or any external api which are available for this. Actually i want to change the content of ppt file dynamically in c#. If u know any solution reagarding this then please let me know.

Here is code:
C#
PowerPoint.Application pptApp = new PowerPoint.Application();
pptApp.Visible = Office.MsoTriState.msoTrue;
var pptPresent = pptApp.Presentations;
var fileOpen = pptPresent.Open(@file, Office.MsoTriState.msoFalse, Office.MsoTriState.msoTrue, Office.MsoTriState.msoTrue);

// getting first slide
PowerPoint.Slide objSlide = fileOpen.Slides[1];

//Create activex object
ShockwaveFlash objswf = new ShockwaveFlash();
objswf.Movie = "#";

//how to add this object on ppt slide..

// saving the ppt
fileOpen.SaveAs("test.pptx", PowerPoint.PpSaveAsFileType.ppSaveAsDefault, Office.MsoTriState.msoTrue);

// close the ppt
fileOpen.Close();

i am trying to add activex object programmtically. please help me to do this.

Thanks.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900