I want to select a "Type" of presentation on the first slide, like "Private", "Public", "Confidential", etc. in an ActiveX Combobox and have the selected value show at the bottom of future slides in an ActiveX TextBox.
I have the Slide 1 Combobox working fine. I run the presentation, get focus, pull-down and select my value. It is ComboBox1.
I can't seem to find the trick to reference that Value in future slides. Extremely novice in vb. Not sure I'm using the PowerPoint vb editor properly. Seems my code/values are just limited to the current slide and not future slides.
On slide 2 I have TextBox1 defined. I can get it to take a value with TextBox1.Value = "This is a " & ComboBox1 & " slide." But all that displays is "This is a slide". I've tried everything I can't find a way to reference that first slide ComboBox1 value but I can't.
Is it possible?
Thanks!
Inserting source.
This is working on Slide 1.
Option Explicit
Private Sub ComboBox1_GotFocus()
If ComboBox1.ListCount = 0 Then AddDropDownItems
MsgBox "Currently:" & ComboBox1.Value
End Sub
Sub AddDropDownItems()
ComboBox1.AddItem "Private"
ComboBox1.AddItem "Confidential"
ComboBox1.AddItem "Secret"
ComboBox1.AddItem "Public"
ComboBox1.AddItem "Test"
ComboBox1.ListRows = 5
End Sub
Private Sub ComboBox1_LostFocus()
MsgBox "Changed to:" & ComboBox1.Value
End Sub
This is not working on Slide 2:
Private Sub TextBox1_Change()
TextBox1.Value = "Change: " &
ActivePresentation.Slides(1).Shapes("ComboBox1").OLEFormat.Object.Value &
"is the Type"
End Sub
Option Explicit
in your code modules? If not, do you get an error becauseComboBox1
is probably out of scope? – David Zemens