#1
|
|||
|
|||
VBA trigger for drop down list box in powerpoint
Hi Forum,
I have a powerpoint presentation with 100 slides, I would like to provide a way for the user to navigate (jump) to one of these slides rather than have to step through them sequentially. I was thinking a drop down menu might be a good solution, the user would simply select from the dropdown list and an automation would jump to the corresponding slide. Please feel free to suggest a simpler approach howerver if you agree with the drop down method, below shows what I have done so far. Also I have attached a non-working example of what I am trying to accomplish. Thanks everyone for reading this thread, The internet is full of examples of how to make a drop down menu (most suggest using MSOFFICE InfoPath (I am using 2007) and specify these steps: (1) design a form template, (2) blank, controls, (3) drop down list box, (4) properties, (5) then add some drop down criterial. I can then copy and paste this into a powerpoint presentation and in presentation mode I now have a workng drop down menu. How do I make this drop down menu trigger some VBA code? My plan is to have the VBA code read the contents of the drop down then match it to a list on slide 101 (which is represented by slide 4 in the attachment) which will yield a slide number, and then jump to that slide number. The list on slide 101 will be copied from Excel and pasted into slide 101 (slide 4 of the attachment) for use by the macro. Back to MSOFFICE InfoPath, if I right click on the drop down menu and select PROGRAMMING, I see Changing Event, Validating Event, Changed Event. This looks like the VBA trigger I am looking for, when I select one of these a bunch of code appears in the VBA editor of InfoPath (a message says "this form template must be saved before VBA code can be added..."). When I paste the drop down list box into PowerPoint this code is excluded. If I run the code from the vba editor of InfoPath it puts InfoPath into preview mode. Am I suppose to develop the VBA code in InfoPath or in my powerpoint presentation? Also, I could use some help writing this macro, how do I read the contents of the drop down list box? Here is the code that InfoPath provided: Code:
Imports Microsoft.Office.InfoPath Imports System Imports System.Windows.Forms Imports System.Xml Imports System.Xml.XPath Imports mshtml Namespace Template2 PublicClass FormCode ' Member variables are not supported in browser-enabled forms. ' Instead, write and read these values from the FormState ' dictionary using code such as the following: ' ' Private Property _memberVariable() As Object ' Get ' _memberVariable = FormState("_memberVariable") ' End Get ' Set ' FormState("_memberVariable") = value ' End Set ' End Property ' NOTE: The following procedure is required by Microsoft Office InfoPath. ' It can be modified using Microsoft Office InfoPath. PrivateSub InternalStartup(ByVal sender AsObject, ByVal e As EventArgs) HandlesMe.Startup AddHandler EventManager.XmlEvents("/my:myFields/my:field1").Changing, AddressOf field1_Changing AddHandler EventManager.XmlEvents("/my:myFields/my:field1").Validating, AddressOf field1_Validating EndSub PublicSub field1_Changing(ByVal sender AsObject, ByVal e As XmlChangingEventArgs) ' Ensure that the constraint you are enforcing is compatible ' with the default value you set for this XML node. ' Write your code here. EndSub PublicSub field1_Validating(ByVal sender AsObject, ByVal e As XmlValidatingEventArgs) ' Write your code here. EndSub EndClass EndNamespace |
#2
|
|||
|
|||
is this in EDIT or SHOW view??
|
Tags |
drop down menu, vba trigger |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to import list from Excel into drop-down list into word | ahw | Word VBA | 43 | 02-28-2020 08:11 PM |
Drop down list, Can it be done??? | garethreid | Outlook | 0 | 08-09-2012 06:08 AM |
Trigger select in Powerpoint 2007 | slothman2000 | PowerPoint | 2 | 06-06-2012 01:04 PM |
Trouble with drop down list | yessmarie | Word VBA | 1 | 05-25-2012 12:43 PM |
Drop Down List using SYMBOLS | sm5948 | Word | 2 | 09-28-2011 05:05 AM |