Google Grupper støtter ikke lenger nye Usenet-innlegg eller -abonnementer. Historisk innhold er fortsatt synlig.

host powerpoint object in web browser control

Sett 12 ganger
Hopp til første uleste melding

Albert Huang

ulest,
25. okt. 2002, 02:43:1825.10.2002
til
Hi all,

I'm hosting a powerpoint presentation in a webbrowser control and am trying
to access some of the automation controls that it is supposed to expose.
This is in all in C#. My problem is that many of these controls don't seem
to work, and I'm wondering if I'm doing anything wrong. Specifically, I
want access to the PowerPoint.ActiveWindow object.

So when I load the .PPT in the webbrowser control, I get a handle to a
PowerPoint.Presentation object. This is fine. The Application handle of
the object, however, comes out inactive and doesn't allow me to access the
ActiveWindow property, even though there is clearly an active
DocumentWindow. In fact, when I iterate through all of the DocumentWindow
objects in both the Application.Windows and the Presentation.Windows
collections, they are all null.

PowerPoint.Presentation pres = webBrowserControl.Document as
PowerPoint.Presentation; // this works fine
PowerPoint.Application app = pres.Application; // this works fine, but the
app's properties aren't fine
PowerPoint.DocumentWindow window = app.ActiveWindow; // this is just
completely invalid

Can anyone give me some advice on what to do? All I want is to load the
.PPT and be able to access the slides and objects selected by the user.
Normally, I'd do this through ActiveWindow.Selection, but I feel like I've
hit a brick wall. Thanks in advance!

-Albert

0 nye meldinger