View Single Post
 
Old 11-08-2022, 02:44 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,384
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

A trivial demonstration of using arrays in Word:

Code:
Sub Demo()
Application.ScreenUpdating = False
Dim MyArray() As String, i As Long, j As Long
For i = 10 To 1 Step -1
  ReDim Preserve MyArray(j)
  StrTxt(j) = i: j = j + 1
Next
MsgBox UBound(MyArray) ' Count of array elements (0-based)
MsgBox Join(MyArray(), ", ") ' Unsorted list of array elements
WordBasic.SortArray MyArray() ' Sort the array
MsgBox Join(MyArray(), ", ") ' Sorted list of array elements
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote