Hi, i'm trying to create a listbox that holds all "Figure" cross references in it. The problem is that when I run the following code, it will only store a maximum of 8 figures. The strange thing is that if I step through the code line by line, it will store all 44 figures. I can't figure out why this is happening.
Code:
Private Sub UserForm_Initialize()
Dim varXRefs() As String
Dim Index As Integer
Dim c As Integer
Selection.Fields.Update
' Clear out any previous contents
Me.cboFigureNumber.Clear
' Load just the figures into varXRefs
varXRefs = ActiveDocument.GetCrossReferenceItems _
(ReferenceType:="Figure")
c = UBound(varXRefs)
' Load the ListBox from varXRefs as an array
For Index = 1 To UBound(varXRefs)
Me.cboFigureNumber.AddItem varXRefs(Index)
Next Index
End Sub