|
我在你年前从某处找过一段vba的语句。最近word升级到2016后,这段程序不运行了,请高手帮我检查一下,是什么原因。多谢!
目的是把word里面的段落按字数排序用的。
Dim myPar As Paragraph
With ActiveDocument.Content
'假设文档中没有数字后跟制表符的字符串
For Each myPar In .Paragraphs
If Len(myPar.Range.Text) > 1 Then _
myPar.Range.InsertBefore Len(myPar.Range.Text) & vbTab
Next
.Sort ExcludeHeader:=False, FieldNumber:="域 1", SortFieldType:= _
wdSortFieldNumeric, SortOrder:=wdSortOrderAscending, FieldNumber2:="", _
SortFieldType2:=wdSortFieldSyllable, SortOrder2:=wdSortOrderAscending, _
Separator:=wdSortSeparateByTabs, SortColumn:=False, _
CaseSensitive:=False, LanguageID:=wdSimplifiedChinese
.Find.Execute findtext:="[0-9]@^t", replacewith:="", MatchWildcards:=True, Replace:=wdReplaceAll
End With
是因为vba版本变动不能用了?我试了wps2019里也不能用,请高手指教修改,多谢!!
|
|