我用VBA做了一个评分软件,要评6分的,但我只评了3分,请会VBA的大大看看我那里错了word的正文如下:网络安全大家谈
网络安全是一个关系国家安全和主权、社会的稳定、民族文化的继承和发扬的重要问题。其重要性,正随着全球信息化步伐的加快而变到越来越重要。“家门就是国门”,安全问题刻不容缓。网络安全是一门涉及计算机科学、网络技术、通信技术、密码技术、信息安全技术、应用数学、数论、信息论等多种学科的综合性学科。
网络安全是指网络系统的硬件、软件及其系统中的数据受到保护,不受偶然的或者恶意的原因而遭到破坏、更改、泄露,系统连续可靠正常地运行,网络服务不中断。
对安全保密部门来说,他们希望对非法的、有害的或涉及国家机密的信息进行过滤和防堵,避免机要信息泄露,避免对社会产生危害,对国家造成巨大损失。
从社会教育和意识形态角度来讲,网络上不健康的内容,会对社会的稳定和人类的发展造成阻碍,必须对其进行控制。要求:
打开Word文档(文件名为:exam_word.doc),然后进行如下操作。
(1)给文章加标题:“网络安全大家谈”,要求:居中,设置标题字体:宋体、粗体、二号、红色、字符缩放200%;
(2)将正文的第一段首字下沉2行,首字字体为楷体、斜体、蓝色;
(3)将正文中所有“安全”设置为黑体、加粗、加单下划线;
(4)将正文的第二段分成等宽的三栏,栏间加分隔线;
(5)设置页眉:“计算机世界”,五号,楷体,粗体,居中;
(6)将文章标题行加上1.5磅带阴影的红色边框、30%的底纹,颜色:黄色;
将编辑好的文件存放于D盘Ks_Word文件夹中。我的代码:
Sub Auto_pj()
    On Error GoTo err
    Dim doc1 As Document  '定义一个document对象
    Set doc1 = CreateObject("word.document")  '创建一个document对象
    Set doc1 = Word.Documents.Open(FileName:="d:\ks_word\exam_word.doc", ReadOnly:=True)  '以只读方式打开一个文档,返回一个document对象
    MsgBox ActiveDocument.Name, , "当前活动文档的文件名称是:"
    score = 0  '变量score用于记录考生得分
    '检查规定目录下是否有所要求的文件
    'ChangeFileOpenDirectory "D:\ks_word\"
        doc1.Activate
    '检查文章标题是否正确
    Selection.HomeKey unit:=wdLine
    Selection.MoveRight unit:=wdCharacter, Count:=7, Extend:=wdExtend
    If Selection.Text = "网络安全大家谈" And Selection.ParagraphFormat.Alignment = _
    wdAlignParagraphCenter And Selection.Font.Scaling = 200 Then
    score = score + 1 '若正确,则加分
    End If
     '检查第一段首字格式
    Selection.MoveRight unit:=wdCharacter, Count:=2
    Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdExtend
    If Selection.Paragraphs(1).DropCap.LinesToDrop = 2 Then
        If Selection.Font.Italic = True And Selection.Font.Color = wdColorBlue And _
        Selection.Font.Name = "楷体_GB2312" Then
            score = score + 1
        End If
    End If
    ' 查找每一个“安全”,是否都已变为要求的格式,文档中共有7个“安全”
    With Selection.Find
        .Text = "安全"
            .Forward = True
        .Wrap = wdFindContinue
    End With
j = 0
For i = 1 To 7
        If Selection.Find.Execute = True Then
                If Selection.Font.Name = "黑体" And Selection.Font.Underline = wdUnderlineSingle Then
        j = j + 1
                End If
         End If
Next i
If j = 7 Then
    score = score + 1
End If
    '检查文章第二段是否已分为3栏,是否有分隔线
    Selection.HomeKey unit:=wdStory
    Selection.MoveDown unit:=wdParagraph, Count:=2
    Selection.MoveDown unit:=wdParagraph, Count:=1, Extend:=wdExtend
    Selection.MoveLeft unit:=wdCharacter, Count:=1, Extend:=wdExtend
    ActiveDocument.Range(Start:=Selection.End, End:=Selection.End).InsertBreak Type:= _
    wdSectionBreakContinuous
    If Selection.PageSetup.TextColumns.Count = 3 And Selection.PageSetup.TextColumns.LineBetween _
    <> 0 Then
        score = score + 1
    End If
    '检查页眉是否设置正确
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Application.WindowState = 1
    Selection.EndKey unit:=wdLine, Extend:=wdExtend
    Selection.MoveLeft unit:=wdCharacter, Count:=1, Extend:=wdExtend
    If Selection.Text = "计算机世界" And Selection.ParagraphFormat.Alignment = _
    wdAlignParagraphCenter And Selection.Font.Bold = True And Selection.Font.Name = "楷体GB_2312" Then
        score = score + 1
    End If
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    '检查标题行的边框设置是否正确
    Selection.HomeKey unit:=wdStory
    Selection.EndKey unit:=wdLine, Extend:=wdExtend
        Selection.MoveLeft unit:=wdCharacter, Count:=1, Extend:=wdExtend
        If Selection.Font.Shading.Texture = wdTexture30Percent And _
        Selection.Font.Shading.ForegroundPatternColor = wdColorYellow And _
        Selection.Font.Shading.BackgroundPatternColor = wdColorAutomatic And _
        Selection.Font.Borders(1).LineStyle = wdLineStyleSingle And _
        Selection.Font.Borders(1).LineWidth = wdLineWidth150pt And _
        Selection.Font.Borders(1).Color = wdColorRed And _
        Selection.Font.Borders.Shadow = True And Options.DefaultBorderLineStyle = _
        wdLineStyleSingle And Options.DefaultBorderLineWidth = wdLineWidth150pt And _
        Options.DefaultBorderColor = wdColorRed Then
            score = score + 1
        End If
        m = MsgBox("分数:" + CStr(score))  '给出最终分数
        ActiveWindow.Close  '阅卷完毕,关闭文档
    Exit Sub
err:
        m = MsgBox("出错")
    End Sub我前三分拿了,就是后面的三分出不来,请问我后面三个要怎样改?