|
从上面两幅图来看,只有字色发生变化,字体和区域没有变,如果区域没有错误的话,那么,可能就是你的电脑上没有”华文行楷”的字体。我再改一下,你测试。
Sub 同时选取并改变多个独立区域格式()
'On Error Resume Next
arr = Array("黑色", "蓝色", "青绿色", "鲜绿色", "粉红色", "红色", "黄色", "深蓝色", "青色", "绿色", "紫色", "深红色", "深黄色")
With ActiveDocument
.DeleteAllEditableRanges wdEditorEveryone '删除所有可编辑的区域
With .Content.Font
.Name = "楷体"
.ColorIndex = wdAuto
.Size = 12
End With
For i = 1 To .Paragraphs.Count
Randomize
m = Int(Rnd * 5 + 1) * i
n = Int(Rnd * 6 + 1) * i
.Range(.Paragraphs(i).Range.Start + m, .Paragraphs(i).Range.End - n).Editors.Add wdEditorEveryone
Next
.SelectAllEditableRanges wdEditorEveryone '选中所有可编辑区域
With Selection.Font
Randomize
x = Int(Rnd * 12 + 1)
y = Int(Rnd * 5)
.Name = "仿宋"
.ColorIndex = Array(1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14)(x)
.Size = 7 + y
End With
End With
End Sub
|
|