WORD VBA sorting words in paragraphs -


Hi guys, I'm hoping you can tell me in the right direction. I am trying to come up with a macro which will sort the words in ascending order for each paragraph. To illustrate this I am giving an example below:

  Quick brown fox jumps on lazy dogs. & Lt; -------------------------------------------------------------- ---- Output   

The output should show down under paragraph / S Docu been already sorted as any help or advise me how to use the range of about I can, please tell me thank you!

I believe this code can tell you in the right direction.

Note that you will need to add the sorted array (as of now, it is only sorting array values).

I used the sorting function.

Hope this will help!

  Specify the option of text as a sub-order paragraph () Dim ongraph word. Paragraph deem vParagraphText for each overgrowth as an ActiveDocument. Paragraphs if the lane (Trim (OperaGrange Test)) 0 then vParagraphText = oParagraph.Range.Text vParagraphText = Split (vParagraphText, "") SortArray vParagraphText End If Next Ofargraf End Sub Private Function Sortarere (Jyariar as Bayreriyl) Dim x As Integer Dim Boolean Dimt Templest as string as bSorted = False Do not, while bSorted bSorted = 1 - UBound (TheArray) from x = 0 to True if TheArray (x) & gt; TheArray (x + 1) and sTempText = TheArray (x + 1) TheArray (x + 1) = TheArray (x) TheArray (x) = sTempText bSorted = False End If Next x loop and function    

Comments