
Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Thanks for the reply.
Our structure is such that it would take months to get approval to purchase
and install any third party software, such as Apose. I am only opening a
powerpoint template and then adding four text boxes to it. That's it. With
that little bit of work, you still say it is not a good thing. This is our
only option at the moment, and any other options would take months to
complete. This is on our intranet server, with no more than two or three
users at any one time, if that makes a difference.
Why would Microsoft offer the ability to hook into Powerpoint if they
recommend against it?
Here is the code that does this (and one section for inserting one textbox):
PowerPoint.Application pp = new
Microsoft.Office.Interop.PowerPoint.Application();
pp.Visible = MsoTriState.msoTrue;
PowerPoint.Presentations presentations = pp.Presentations;
PowerPoint._Presentation presentation =
presentations.Open("D:\\Templates\\quadchart.pot", MsoTriState.msoFalse,
MsoTriState.msoTrue, MsoTriState.msoTrue);
PowerPoint.Slides slides = presentation.Slides;
PowerPoint._Slide slide = slides.Add(1,
PowerPoint.PpSlideLayout.ppLayoutBlank);
//Title
Microsoft.Office.Interop.PowerPoint.Shape ppTitle =
slide.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationHorizontal, 100,
25, 600, 320);
ppTitle.TextFrame.TextRange.Text = projectName;
ppTitle.TextFrame.TextRange.Font.Size = 32;
ppTitle.TextFrame.TextRange.Font.Bold = MsoTriState.msoTrue;
> > Does my server need Office, or at least powerpoint, installed?
>
[quoted text clipped - 6 lines]
> All you need is this:
> http://www.aspose.com/Products/Aspose.Slides/Default.aspx
Mark Rae [MVP] - 19 Dec 2007 20:50 GMT
> This is our only option at the moment,
Can't help that... Aspose really isn't very expensive, and it will solve
your problem in about half an hour...
> This is on our intranet server, with no more than two or three
> users at any one time, if that makes a difference.
It doesn't... Read the MSDN article again...
Here's further information:
http://support.microsoft.com/default.aspx/kb/288367. Note specifically:
"risky and unstable", "stop responding", "corrupt data", "crash the calling
process", "bring down the web server" etc...
I'm really not making this up...
> Why would Microsoft offer the ability to hook into Powerpoint if they
> recommend against it?
Because it's simply not designed for remote automation on a server because
of its threading model - desktop automation works perfectly...
> Here is the code that does this (and one section for inserting one
> textbox):
<snip>
Makes no difference what your code is - it's just not designed to work in
this environment...
I suggest you show the two MSDN articles to your boss...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
bruce barker - 19 Dec 2007 21:12 GMT
automation is supported from a client app, just not from a service (like
asp.net). the microsoft link gives reasons why. if you can live with the
cavets, then yes, you need to install powerpoint on the server. be sure to
follow all the links, and address each issue that applies.
-- bruce (sqlwork.com)
> Thanks for the reply.
>
[quoted text clipped - 41 lines]
> > All you need is this:
> > http://www.aspose.com/Products/Aspose.Slides/Default.aspx