Cannot start PowerPoint from ASP.Net

G

Gary A. Bushey

I am trying to create slides dynamically via ASP.Net. I have code that
worked great under Windows but does not run under ASP.Net. When I try to
set objPresSet I get the message "The message filter indicated that the
application is busy."
Any idea what that means and how to fix it? Code follows below....

objApp = new PowerPoint.Application();
objApp.Visible = MsoTriState.msoTrue ;

//***Line below causes error
objPresSet = objApp.Presentations;
//***
objPres = objPresSet.Open(strTemplate,
MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
objSlides = objPres.Slides;

//Build Slide #1:
//Add text to the slide, change the font and insert/position a
//picture on the first slide.
objSlide = objSlides.Add(1,PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
objTextRng = objSlide.Shapes[1].TextFrame.TextRange;
objTextRng.Text = "My Sample Presentation";
objTextRng.Font.Name = "Comic Sans MS";
objTextRng.Font.Size = 48;
objSlide.Shapes.AddPicture(strPic,MsoTriState.msoFalse,
MsoTriState.msoTrue,0,0,700,500);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top