-1

I declared array() as string and had array() with values of 282 characters

When there is a conflict between the heart and the brain, let the heart be followed.. A man of intellect can turn into a devil, but never a man of heart. Everything can be sacrificed for truth, but truth can't be sacrificed for anything. There is no misery where there is no want.

I tried to print it in another page using typetext option it prints only 255char only up to this

When there is a conflict between the heart and the brain, let the heart be followed.. A man of intellect can turn into a devil, but never a man of heart. Everything can be sacrificed for truth, but truth can't be sacrificed for anything. There is no mis

Any suggestion regarding this, How do i get it with the actual range?

Sub Sortingauthor()
Dim TheInput As String
Dim Authorreference() As String
Dim SortedAuthorreference() As Variant
Dim i As Integer
Dim ReferenceCount As Integer
Dim References(1000) As String

ReferenceCount = InputBox("Enter the Number of References", "No. of References")

ReDim Authorreference(1 To ReferenceCount)
ReDim SortedAuthorreference(1 To ReferenceCount)

Selection.HomeKey unit:=wdStory
With Selection.Find
    .text = "^pReferences^p": 
    .Replacement.text = vbnullstring:  
    .Forward = True: 
    .Wrap =      wdFindContinue: 
    .Format = False:  
    .MatchCase = False: 
    .MatchWholeWord = True: 
    .MatchWildcards = False:        
    .MatchSoundsLike = False: 
    .MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight unit:=wdCharacter, count:=1

For i = 1 To ReferenceCount
    Selection.MoveDown unit:=wdParagraph, count:=1, Extend:=wdExtend
    Authorreference(i) = Selection.Range.text
    Selection.MoveRight unit:=wdCharacter, count:=1
Next i

WordBasic.sortarray Authorreference()

For i = 1 To (UBound(Authorreference()))
    SortedAuthorreference(i) = Authorreference(i)
    MsgBox (SortedAuthorreference(i))
Next i

End Sub
4

1 回答 1

0

数组值在排序前正确打印。但是在使用 wordbasic.sortarray 命令进行排序后。自打印以来,它最多只能扩展 255 个字符。如果我们想对超过 255 个字符的数组进行有效排序,我们必须使用快速排序或冒泡排序。

于 2012-07-02T09:02:12.640 回答