Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Powerpoint and VBA?

Posted on 1999-07-10
10
Medium Priority
?
838 Views
Last Modified: 2010-09-13
I need to know what is the VBA code in powerpoint that allow me to go to a certain slide. For example, the user may click on a command button that allow him/her to go slide 15.
Your help is appreciated.
0
Comment
Question by:Shaheen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 1523452
Hi Shaheen,

Try this code under your button in PowerPoint,

Sub PushToSlide()
   
  'the index will determine which slide you goto
  ActiveWindow.View.gotoslide Index:=15

End Sub

Hope this helps,
:O)Bruintje
0
 

Author Comment

by:Shaheen
ID: 1523453
Actually, I have another question, if you can anwer it then I will increase the points to 100points. The question is:
I have a powerpoint presentation, on the slide master there is a combo box, where in the VB code (under what event or sub) I would be able to enter data in order to add text to the combo box?
Thank you for your help
0
 

Author Comment

by:Shaheen
ID: 1523454
I am afraid that the answer you put did not solve my problem, I am re-posting the question and re-phrasing it to the following:
I have a Power point Slide show that have 40 slides, The Master Slide contains a combo box, what I need to do is:
1. When the user decides to use the "View Show" under the "Slide show" menu, the combo box should load all the entries required.
2. When The user select an entry (which refers to a slide) in the combo box, this slide will automatically be shown.
Regards
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 44

Expert Comment

by:bruintje
ID: 1523455
That's a very nice tactic to reject an answer and then ask another question.......................:O)


OK sun shining bright, so I better shed some light.......

If want to use a combobox in Powerpoint you have to load the available slides i a array into the box like this,

Private Sub Combox1_Change

'Declares an Array as 39 rows by 1 column
Dim cbArray(39,1)

ComboBox1.ColumnCount = 1

'Load Columns 1 and 2 of cbArray

For i = 0 to 39
  cbArray(i,0) = "Slide " & i
Next

'Load data into combobox
ComboBox1.List = cbArray

End Sub

For the onclick event of the ComboBox1 just put the code I gave you earlier..........like this

Sub ComboBox1.Click()
     
  'the index of the box will determine which slide you goto
  ActiveWindow.View.gotoslide Index:= ComoboBox1.ListIndex

End Sub

It should point you in the right way................

Good Luck,
:O)Bruintje


0
 

Author Comment

by:Shaheen
ID: 1523456
Bruintje,
Loading the slide names worked fine, however clicking on the combobox returns the following error (under sub combox1_Click)
"Runtime error :-2147188160 (80048240)
Document Window (Unkown member): Failed

Any solution for this problem.
Regards
0
 

Author Comment

by:Shaheen
ID: 1523457
Lock the question
0
 
LVL 44

Accepted Solution

by:
bruintje earned 400 total points
ID: 1523458
I didn't test it, just woke up at that time.......

seems you have to put this into a few pieces just to see what's wrong.........

Sub ComboBox1.Click()
     
  'the index of the box will determine which slide you goto
  ActiveWindow.View.gotoslide Index:= ComoboBox1.ListIndex

End Sub

Maybe first declaring a variable SlideIndex
Put the SlideIndex = ComoboBox1.ListIndex
Then ActiveWindow.View.gotoslide Index:= SlideIndex

Then you could see where things go awry........

Be back at the other end of this day........
:O)Bruintje

0
 
LVL 44

Expert Comment

by:bruintje
ID: 1523459
Hi again, was your problem solved yet......have to catch some sleep but in 7 hours I'll be back....and if you need something else name it........

:O)Bruintje
0
 

Author Comment

by:Shaheen
ID: 1523460
Problem has been solved
0
 
LVL 44

Expert Comment

by:bruintje
ID: 1523461
great!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question