Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,070 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,595 people online right now. Registration is fast and FREE... Join Now!




Displaying Power Point in PictureBox/Webrowser

 
Reply to this topicStart new topic

Displaying Power Point in PictureBox/Webrowser

cbr4rusty
15 Apr, 2008 - 08:07 PM
Post #1

New D.I.C Head
*

Joined: 15 Apr, 2008
Posts: 25

Hi, I've only taken 2 programming classes thus far so I am fairley new to it all (but I love it so far!). I made an application to take and store all my notes for all my different classes (college). The problem I am having is, I want to display a powerpoint and be able to navigate through it in either a webrowser or picturebox beside my richtextbox for my notes. Is there a simple way to do this? I've searched the web a lot and can't seam to find anything? Any help would be great! thanks


Rusty

User is offlineProfile CardPM
+Quote Post

skaoth
RE: Displaying Power Point In PictureBox/Webrowser
15 Apr, 2008 - 10:50 PM
Post #2

D.I.C Regular
Group Icon

Joined: 7 Nov, 2007
Posts: 342



Thanked: 10 times
Dream Kudos: 100
My Contributions
I'm accustomed to using the IWebBrowser2 interface to use IE within an application.
However, if you are using winforms then you should just be able to drag and drop the
webbrowser control onto the form

The browser object can be created like this
CODE

this.webBrowser1 = new System.Windows.Forms.WebBrowser();

// To open up your ppt.  just navigate to the location of the ppt file
this.webBrowser1.Navigate("PATH_TO_PPT_FILE");


hope that helps
User is online!Profile CardPM
+Quote Post

cbr4rusty
RE: Displaying Power Point In PictureBox/Webrowser
16 Apr, 2008 - 01:08 PM
Post #3

New D.I.C Head
*

Joined: 15 Apr, 2008
Posts: 25

QUOTE(skaoth @ 15 Apr, 2008 - 11:50 PM) *

I'm accustomed to using the IWebBrowser2 interface to use IE within an application.
However, if you are using winforms then you should just be able to drag and drop the
webbrowser control onto the form

The browser object can be created like this
CODE

this.webBrowser1 = new System.Windows.Forms.WebBrowser();

// To open up your ppt.  just navigate to the location of the ppt file
this.webBrowser1.Navigate("PATH_TO_PPT_FILE");


hope that helps


skaoth:

Thanks, but it gives me a "Web Page not Found" deal....?
User is offlineProfile CardPM
+Quote Post

skaoth
RE: Displaying Power Point In PictureBox/Webrowser
16 Apr, 2008 - 02:46 PM
Post #4

D.I.C Regular
Group Icon

Joined: 7 Nov, 2007
Posts: 342



Thanked: 10 times
Dream Kudos: 100
My Contributions
Make sure that the path path is correct. For testing purposes try a complete path e.g: "c:\myfolder\myppt.ppt" otherwise it should work. If not post your code
User is online!Profile CardPM
+Quote Post

cbr4rusty
RE: Displaying Power Point In PictureBox/Webrowser
16 Apr, 2008 - 08:34 PM
Post #5

New D.I.C Head
*

Joined: 15 Apr, 2008
Posts: 25

QUOTE(skaoth @ 16 Apr, 2008 - 03:46 PM) *

Make sure that the path path is correct. For testing purposes try a complete path e.g: "c:\myfolder\myppt.ppt" otherwise it should work. If not post your code





This is the code that I have:
CODE

        private void button2_Click(object sender, EventArgs e)
        {
            // To open up your ppt.  just navigate to the location of the ppt file
            webBrowser1.Navigate("C:/Users/Rusty/Desktop/NT/SizeTester/SizeTester/bin/Debug/BankAccounts.ppt");
        }


When I run this code i get a DialogBox [open, save, or cancle]. If I click open it gives me this error = file is not a valid Win32 App. If I hit Save it opens the Save Dialog Box....am I doing something wrong? Or is it not possible to show the ppt in a webrowser or picture box?? Thanks for the help!



Rusty


User is offlineProfile CardPM
+Quote Post

skaoth
RE: Displaying Power Point In PictureBox/Webrowser
17 Apr, 2008 - 12:06 AM
Post #6

D.I.C Regular
Group Icon

Joined: 7 Nov, 2007
Posts: 342



Thanked: 10 times
Dream Kudos: 100
My Contributions
I assume that this is a winform application? if not then my code example will not work. If it is then you need to make sure that you drag and drop a WebBrowser control onto the form that will be displaying the ppt file.

the code this.webBrowser1 = new System.Windows.Forms.WebBrowser(); will be done for you behind the scene when you drop the control on the form.

The webbrowser control as far as I know uses the IE renedering engine. Also I think you have to have Powerpoint installed or powerpointview (not sure about this one) for this to work
because IE uses ActiveX to render office documents in IE.

This post has been edited by skaoth: 17 Apr, 2008 - 12:07 AM
User is online!Profile CardPM
+Quote Post

cbr4rusty
RE: Displaying Power Point In PictureBox/Webrowser
17 Apr, 2008 - 08:09 AM
Post #7

New D.I.C Head
*

Joined: 15 Apr, 2008
Posts: 25

QUOTE(skaoth @ 17 Apr, 2008 - 01:06 AM) *

I assume that this is a winform application? if not then my code example will not work. If it is then you need to make sure that you drag and drop a WebBrowser control onto the form that will be displaying the ppt file.

the code this.webBrowser1 = new System.Windows.Forms.WebBrowser(); will be done for you behind the scene when you drop the control on the form.

The webbrowser control as far as I know uses the IE renedering engine. Also I think you have to have Powerpoint installed or powerpointview (not sure about this one) for this to work
because IE uses ActiveX to render office documents in IE.



Sorry, I should have given you more details initially. This is a C# windows form application. I have droped a webrowser in to the form. It is called: webBrowser1. When the code is run it brings up a dialog box giving me three options (open, save, cancle) If i select open an error message occurs saying the file (c:/.../BankAccounts.ppt) is not a valid Win32 Application. And that is where I sit? Thanks for the help so far!


CODE

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Web;
using System.IO;



        private void button2_Click(object sender, EventArgs e)
        {
            this.webBrowser1 = new System.Windows.Forms.WebBrowser();
            // To open up your ppt.  just navigate to the location of the ppt file
            webBrowser1.Navigate("C:/Users/Rusty/Desktop/NT/SizeTester/SizeTester/bin/Debug/BankAccounts.ppt");
        }



Rusty
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 07:02PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month