' 字体类型 R_Character.Font.Name = FontName(0) ' 字号大小 R_Character.Font.Size = FontSize(Int(VBA.Rnd * FontSizeLength) + 1) ' 字的上下偏移 R_Character.Font.Position = Choose(Int(VBA.Rnd * 5) + 1, -1, -0.5, 0, 0.5, 1) + a ' 字的左右间距 R_Character.Font.Spacing = Choose(Int(VBA.Rnd * 5) + 1, -1, -0.5, 0, 0.5, 1) + b '这是修改字符字体的代码,如果需要修改英文和数字的字体,可以在这里修改 If R_Character = "。" Or R_Character = "," Or R_Character = "," Or R_Character = ";" Or R_Character = "’" Or R_Character = "‘" Or R_Character = "“" Or R_Character = "”" Or R_Character = "!" Or R_Character = "?" Or R_Character = "、" Or R_Character = ":" Then ' 中文常用标点符号 R_Character.Font.Name = "汉仪晨妹子W" ElseIf Asc(R_Character) >= 48 And Asc(R_Character) <= 57 Then ' 数字 R_Character.Font.Name = "萌妹子体" ElseIf Asc(R_Character) >= 97 And Asc(R_Character) <= 122 Or Asc(R_Character) >= 65 And Asc(R_Character) <= 90 Or R_Character = "." Or R_Character = "(" Or R_Character = ")" Or R_Character = "(" Or R_Character = ")" Then ' 大小写字母 R_Character.Font.Name = "汉仪晨妹子W" End If
Next
For Each Cur_Paragraph In ActiveDocument.Paragraphs ' 设置行间距类型为固定值 Cur_Paragraph.LineSpacingRule = wdLineSpaceExactly ' 设置行间距的值 Cur_Paragraph.LineSpacing = Int(VBA.Rnd * 5) + 1 + c Next
' 设置首行缩进,如不需要注释With到End With这段代码 With Selection.ParagraphFormat ' 每个缩进单位长度,厘米 .FirstLineIndent = CentimetersToPoints(0.35) ' 设置缩进单位 .CharacterUnitFirstLineIndent = 2 End With