Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-08-2022, 02:44 PM
macropod's Avatar
macropod macropod is offline Using .Net arrays in VBA crashes Word Windows 10 Using .Net arrays in VBA crashes Word 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using .Net arrays in VBA crashes Word How to use arrays? Simplifier Excel 1 09-03-2016 03:50 AM
Create an input box for arrays rajani Word VBA 2 08-17-2015 06:28 AM
Variable arrays from user input SeattleITguy Excel Programming 1 01-29-2015 09:19 AM
Using .Net arrays in VBA crashes Word Searching Arrays without Loops? ptmuldoon Word VBA 3 12-13-2014 11:21 AM
Using .Net arrays in VBA crashes Word re-naming arrays in VBA? JDevsFan Excel Programming 4 03-15-2012 08:44 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:51 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft