'Reset the size of the array without losing its values by using Redim Preserve ReDim Preserve DirectoryListArray(Counter - 1) 'To prove it worked you could run the following: For Counter = 0 To UBound(DirectoryListArray) 'Debug.Print writes the results to the Immediate window (press Ctrl + G to view it)'
Debug.Print DirectoryListArray(Counter) Next Counter End Sub
De fleste virksomheder har efterhånden bevist, at AI virker.
Pilotprojekter leverer resultater. Medarbejdere bruger generative AI-værktøjer. Nye use cases dukker op på tværs af organisationen.
For Counter = 0 To UBound(DirectoryListArray) 'Debug.Print writes the results to the Immediate window (press Ctrl + G to view it)'
Debug.Print DirectoryListArray(Counter) Next Counter
…med følgende:
With ActiveDocument 'insert empty paragraph at end of active document .Range.InsertAfter vbCr 'set style to Normal .Paragraphs.Last.Style = "Normal"
'iterate through array and insert a paragraph per item at end of document For Counter = LBound(DirectoryListArray) To UBound(DirectoryListArray) .Range.InsertAfter DirectoryListArray(Counter) & vbCr Next Counter End With
…vil resultatet blive indsat sidst i det aktive dokument, et afsnit for hver, formateret med typografien Normal.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.