Loads up a Listbox and a Combobox
Sub LoadEmUp()
Dim whatever1()
Dim whatever2()
Dim var, var2
whatever1 = Array("LIST_item1", "LIST_item2", "LIST_item3")
whatever2 = Array("COMBO_item1", "COMBO_item2", _
"COMBO_item3", "COMBO_item4", "COMBO_item5")
ListBox1.Clear
ComboBox1.Clear
For var = 0 To UBound(whatever1)
ListBox1.AddItem whatever1(var)
Next
For var2 = 0 To UBound(whatever2)
ComboBox1.AddItem whatever2(var2)
Next
ComboBox1.ListIndex = 0
End Sub
Gets the lists
Sub GetEm()
Dim msg As String
Dim myObject As Object
Dim objInline As InlineShape
Dim var, var2
If ActiveDocument.InlineShapes.Count > 0 Then
For var = 1 To ActiveDocument.InlineShapes.Count
Set objInline = ActiveDocument.InlineShapes.Item(var)
If objInline.Type = 5 Then
For var2 = 0 To objInline.OLEFormat.Object.ListCount - 1
MsgBox objInline.OLEFormat.Object.List(var2)
Next
End If
Next
End If
End Sub
The reason the code checks for Type, is in case there is an InlineShape that
is NOT a wdInlineShapeOLEControlObject (type = 5)
You may need to go deeper with this if you have control objects that are not
either listbox or combobox.
You could use a TypeOf check.
However, I question why you are doing this as you have to populate the list
anyway, to get the list in there. So....you should have the list already.
or are you asking really for something else?
>Hi,
>
[quoted text clipped - 5 lines]
>-----
>Ambiga
fumei - 29 Feb 2008 20:53 GMT
Oh crap. I was going to use a msg string to build the list into ONE message..
.but then forgot to use it.
>Loads up a Listbox and a Combobox
>
[quoted text clipped - 57 lines]
>>-----
>>Ambiga
Ambiga - 04 Mar 2008 12:07 GMT
Thank for your replies, and that solved the problem.
---
Ambiga
> Oh crap. I was going to use a msg string to build the list into ONE message..
> .but then forgot to use it.
[quoted text clipped - 60 lines]
> >>-----
> >>Ambiga