TPE
Tavvafi@gmail.com |
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Sub AddItemsToSelectedListBox() Dim oShape As Shape Set oShape = ActiveWindow.Selection.ShapeRange(1) With oShape.OLEFormat.Object ' Add items to the list .AddItem ("This") .AddItem ("That") .AddItem ("The Other") ' You could work with other properties of the list or combo box here as well End With End Sub
Private Sub ComboBox1_Change() On Error Resume Next SlideShowWindows(1).View.GotoSlide (CLng(ComboBox1)) End Sub Sub InitListBox() Dim oShape As Shape Dim X As Long Set oShape = ActiveWindow.Selection.ShapeRange(1) With oShape.OLEFormat.Object ' Delete any existing items .Clear ' Add items to the list - one for each slide For X = 1 To ActivePresentation.Slides.Count .AddItem (CStr(X)) Next ' You could work with other properties of the list or combo box here as well End With End Sub
Private Sub UserForm_Initialize() ' We'll load the combobox in the userform's Initialize event Dim i As Long Dim MyArray(6, 3) 'Set the combo for 3 data columns, set their widths With Me.cboPicklist .ColumnCount = 3 .Columnwidths = "12;36;36" End With 'Load integer values into first column of MyArray For i = 0 To 5 MyArray(i, 0) = i Next i 'Load columns 2 and three of MyArray; pardon my French MyArray(0, 1) = "Zero" MyArray(1, 1) = "One" MyArray(2, 1) = "Two" MyArray(3, 1) = "Three" MyArray(4, 1) = "Four" MyArray(5, 1) = "Five" MyArray(0, 2) = "Zero" MyArray(1, 2) = "Un ou Une" MyArray(2, 2) = "Deux" MyArray(3, 2) = "Trois" MyArray(4, 2) = "Quatre" MyArray(5, 2) = "Cinq" ' Load the combo box by assigning the array to it Me.cboPicklist.List() = MyArray ' set the selection to the first item on the list ' (list is zero-based) Me.cboPicklist.ListIndex = 0 End Sub