这是我的第一篇文章。我不知道为什么我得到para。显示在我的列表框中的格式符号。
我将文本添加到单词表中,对其进行排序并转移到列表框。我在桌子上尝试了不同的 selection.clearformatting 方法,但没有奏效。我需要从没有段落的列表框中获取文本。符号并用于搜索文本。下面的片段
Do Until n = nmax
With Documents("lb2doc")
.Tables(1).Cell(i, 1).Range.Text = words(n)
.Tables(1).Cell(i, 2).Range.Text = disctime(n)
n = n + 1
i = i + 1
End With
Loop
Dim imax As Long
imax = i
i = 1
'sort table
Documents("lb2doc").Tables(1).Columns(1).Select
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Sort ExcludeHeader:=False, FieldNumber:="Column 2", _
SortFieldType:=wdSortFieldNumeric, SortOrder:=wdSortOrderDescending, _
FieldNumber2:="", SortFieldType2:=wdSortFieldAlphanumeric, SortOrder2:= _
wdSortOrderAscending, FieldNumber3:="", SortFieldType3:= _
wdSortFieldAlphanumeric, SortOrder3:=wdSortOrderAscending, Separator:= _
wdSortSeparateByCommas, SortColumn:=False, CaseSensitive:=False, _
LanguageID:=wdEnglishUS, SubFieldNumber:="Paragraphs", SubFieldNumber2:= _
"Paragraphs", SubFieldNumber3:="Paragraphs"
Dim j As Long
j = 0
ListBox2.ColumnCount = 3
ListBox2.ColumnWidths = "0;60;20"
Do Until i = imax
ListBox2.AddItem
ListBox2.List(j, 1) = Documents("lb2doc").Tables(1).Cell(i, 1).Range.Text
ListBox2.List(j, 2) = Documents("lb2doc").Tables(1).Cell(i, 2).Range.Text
i = i + 1
j = j + 1
Loop