473,248 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,248 software developers and data experts.

Open Powerpoint Slide from a WinForm

I have a VB.Net application and a PowerPoint presentation explaining how each
form in the application works, etc.. I would like to select and display the
slide appropriate for each form by pressing the F1 key. In other words, I
want to use the powerpoint presentation for my help system. I am calling the
SlideShow from the applications menu, and it works great; however, the same
techniques are not working for selecting individual slides.

How do I initialize the PowerPoint application and call an individual slide
from it from each Windows Form? The documentation for PowerPoint is not
adequate for my needs. Products: VB.Net 2..3 (1.1) and Powerpoint 2000
(v.9) Thanks. --
Will
Jul 21 '05 #1
2 10130
First you'll need to add a COM reference to the powerpoint library (unless
you already have the Presentation done and you want to Process.Start it)
Add this
Imports Microsoft.Office.Interop.PowerPoint

Dim present As New Application

present.Activate()

present.SlideShowWindows(Index:=1).View.Next()

The object model is pretty straightforward - if you're going to create new
slides you'll have to do that programatically - just record a macro if you
don't know the object model and that'll give you a good feel for what you
need to do.

HTH,

Bill
--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"WillRead" <wr***@Comporium.org> wrote in message
news:B8**********************************@microsof t.com...
I have a VB.Net application and a PowerPoint presentation explaining how each form in the application works, etc.. I would like to select and display the slide appropriate for each form by pressing the F1 key. In other words, I
want to use the powerpoint presentation for my help system. I am calling the SlideShow from the applications menu, and it works great; however, the same techniques are not working for selecting individual slides.

How do I initialize the PowerPoint application and call an individual slide from it from each Windows Form? The documentation for PowerPoint is not
adequate for my needs. Products: VB.Net 2..3 (1.1) and Powerpoint 2000 (v.9) Thanks. --
Will

Jul 21 '05 #2
Bill,

Thanks. The code below did not work. SlideShowWindows seems to think that it
is an array and wants to have an initial value set. However...

you did nudge me in what I assume is the right direction. Here is what I got
to work -- al least in displaying a particular slide.

Private Sub FindSlide(ByVal n as Int16)

Const sLocation = <my location>

Process.Start(sLocation)
Dim present As New PowerPoint.Application
Dim oPres as PowerPoint.Presentation
' I don't know why, but I had to dimension a variable (oPres) as
PowerPoint.Presentation inorder to get the next line to work....

present.Presentations.Item(1).Slides.FindBySlideID (n).Select()

End Sub

Now, the fun part is that Slide # 1 = SlideID 256 (not 0 or 1), Slide #2 =
SlideID 257, Slide #3 = SlideID 265, Slide #4 = 258, etc. In short, they are
not in consecutive order at all. This is going to make it interesting and a
lot of fun assigning the SlideID values for over 200 forms and slides.

I would appreciate any explanation(s) you can give for any of the above.

Thanks,

You have helped.

Will

"W.G. Ryan eMVP" wrote:
First you'll need to add a COM reference to the powerpoint library (unless
you already have the Presentation done and you want to Process.Start it)
Add this
Imports Microsoft.Office.Interop.PowerPoint

Dim present As New Application

present.Activate()

present.SlideShowWindows(Index:=1).View.Next()

The object model is pretty straightforward - if you're going to create new
slides you'll have to do that programatically - just record a macro if you
don't know the object model and that'll give you a good feel for what you
need to do.

HTH,

Bill
--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"WillRead" <wr***@Comporium.org> wrote in message
news:B8**********************************@microsof t.com...
I have a VB.Net application and a PowerPoint presentation explaining how

each
form in the application works, etc.. I would like to select and display

the
slide appropriate for each form by pressing the F1 key. In other words, I
want to use the powerpoint presentation for my help system. I am calling

the
SlideShow from the applications menu, and it works great; however, the

same
techniques are not working for selecting individual slides.

How do I initialize the PowerPoint application and call an individual

slide
from it from each Windows Form? The documentation for PowerPoint is not
adequate for my needs. Products: VB.Net 2..3 (1.1) and Powerpoint

2000
(v.9) Thanks. --
Will


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: careta | last post by:
Hello, I'm trying to automate PP creation from VB.net. The initial code is (as extracted from MSDN's KB209960): Public Sub Command1_Click() ' Start PowerPoint. Dim ppApp As...
0
by: Ata | last post by:
Hello, I am trying to copy the contents of the output of SQL Reporting Services to a PowerPoint slide. For this, I am using SQL Reporting Services to obtain an IMAGE stream, which I paste to the...
2
by: WillRead | last post by:
I have a VB.Net application and a PowerPoint presentation explaining how each form in the application works, etc.. I would like to select and display the slide appropriate for each form by pressing...
0
by: milkyman | last post by:
Hi there, I hope you can help me. I did download some code, from the Microsoft knolidgebase(MSDN), and it's great. I just don't know how to change the code so that it uses a template, thats on my...
1
by: psuaudi | last post by:
Im using a vb.net app that opens a powerpoint presentation and calls the updatelinks function of powerpoint. One slide in the presentation is linked to a cell range in an excel file, and the...
1
by: EmmettBrown | last post by:
Hello, Just wondering if anyone can advise. I am trying to remotely control Powerpoint using a microprocessor. I am using RS232 (COM1). The idea is that the microprocessor sends ASCII strings...
1
by: bsg92150 | last post by:
i have a task that requires me to provide a web use with the ability to send teh current page to a power point slide. and to further complicate matters. the user may want to put the whole site...
3
by: WPeterson | last post by:
Converting PowerPoint to Flash would absolutely be a good choice to distribute your bulky PowerPoint presentations. You can do the whole PowerPoint to Flash conversion manually or with...
2
by: LucasLondon | last post by:
Hi, I'm trying to use VBA to extract underlying data from charts in powerpoint to excel, i.e from the underlying powerpoint datasheet that feeds the chart. I've found the macro below on the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.