我有段代码在装有word2016的机器上能运行,但在装有word2007的机器上不能运行.代码如下,请指教!
Dim app As New MSWord.Application
app.Selection.HomeKey (Unit:=6)
Dim unitsMoved As Short
Do
unitsMoved = app.Selection.MoveDown(Unit:=4, Count:=5, Extend:=1)
If unitsMoved = 5 And app.ActiveDocument.Range(0, app.Selection.End).Paragraphs.Count <> app.ActiveDocument.Paragraphs.Count Then
app.Selection.InsertAfter (vbCrLf)
End If
Loop Until unitsMoved < 5
app.Selection.WholeStory
app.Selection.Font.Size = 12
app.Selection.Range.ListFormat.ApplyListTemplateWithLevel (ListTemplate:=app.ListGalleries(2).ListTemplates(2), ContinuePreviousList:=False, ApplyTo:=0, DefaultListBehavior:=2)
[此贴子已经被作者于2019/11/1 10:52:10编辑过]