Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Accessing Powerpoint

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wannabe - 19 Dec 2007 17:22 GMT
I have developed an application that opens a powerpoint template, inserts
data from our database into it, and displays it to the user. It works great
on my local development box. Problem is, when I run this from our server, I
only get a blank window, not the powerpoint application showing the chart. I
thought installing the Office 2K3 interoperability tools sdk on the server
would be enough. Is that not the case? Does my server need Office, or at
least powerpoint, installed?
Mark Rae [MVP] - 19 Dec 2007 17:50 GMT
> Does my server need Office, or at least powerpoint, installed?

Under no circumstances install any part of Microsoft Office on your server
and attempt to instantiate it via remote automation. This is extremely risky
and is so unstable that Microsoft actively discourage it to the extent that
they will not support any application which attempts to do it:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2

All you need is this:
http://www.aspose.com/Products/Aspose.Slides/Default.aspx

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Wannabe - 19 Dec 2007 20:37 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.