[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

DsoFramer - Microsoft.Office.Interop.PowerPoint

Mathias

11/8/2007 10:53:00 PM

Hi,

I try to control a PowerPoint Slideshow with c#.
I have a dsoFramer Control (axFramerControl) and can load and view a
powerpoint presentation within my form. When I try to control the
presentation using Microsoft.Office.Interop.PowerPoint I get a Cast
Exception.
Here is some code to understand my problem.

//Load presentation into control
axFramerControl.Open(loc);
//try to get the presentation for controling. Produce a Invalid
CastException.
Microsoft.Office.Interop.PowerPoint.PresentationClass myPres =
(Microsoft.Office.Interop.PowerPoint.PresentationClass)axFramerControl.ActiveDocument;

When I try this with word I have no Problems
Microsoft.Office.Interop.Word.DocumentClass myDoc =
(Microsoft.Office.Interop.Word.DocumentClass)axFramerControl.ActiveDocument;

I hope there is someone who can tell how to get the presentation.

Mathias

1 Answer

Mathias

11/9/2007 12:09:00 AM

0

Hi

I try to control a powerpoint slide show inside a dsoFramer Control
(axFramerControl).
When I press the F5 key, the slides are shown inside my control. When I
try to automate it, the slides are shown in full screen, outside my control.

Here is a part of my code:

Object refmissing = System.Reflection.Missing.Value;
object loc = strFileName;
//open ppt in control - works
axFramerControl.Open(loc, true, refmissing, refmissing, refmissing);
//get reference to ppt inside control
Microsoft.Office.Interop.PowerPoint._Presentation myPres =
(Microsoft.Office.Interop.PowerPoint.Presentation)axFramerControl.ActiveDocument;
//start presentation - does not worg (fullscreen insted of control)
myPres.SlideShowSettings.Run();

I hope someone can help me.

Mathias