Sub WordPF()
Dim WordFS As Single
With Documents("word.doc")
'第1题评分
.Select
With Selection.Find
.Text = "非机"
End With
If Not Selection.Find.Execute Then
With Selection.Find
.Text = "飞机"
.Format = True
.Font.EmphasisMark = wdEmphasisMarkOverSolidCircle
End With
Do While Selection.Find.Execute
n = n + 1
Loop
If n = 15 Then WordFS = WordFS + 2
End If
'第2题评分
If .Paragraphs(1).Alignment = wdAlignParagraphCenter Then WordFS = WordFS + 0.5
If .Paragraphs(1).Range.Font.Name = "楷体_GB2312" Then WordFS = WordFS + 0.5
If .Paragraphs(1).Range.Font.Size = 16 Then WordFS = WordFS + 0.5
If .Paragraphs(1).Range.Font.Color = wdColorBlue Then WordFS = WordFS + 0.5
If .Paragraphs(1).Range.Font.Borders(1).Color = wdColorBlue And .Paragraphs(1).Range.Font.Borders.Shadow = True Then WordFS = WordFS + 1
'第3题评分
With .PageSetup
If .PaperSize = wdPaperA4 Then
If CInt(.PageWidth) = CInt(CentimetersToPoints(21)) And CInt(.PageHeight) = CInt(CentimetersToPoints(29.7)) Then WordFS = WordFS + 1
End If
If CInt(.TopMargin) = CInt(CentimetersToPoints(2)) Then WordFS = WordFS + 0.25
If CInt(.BottomMargin) = CInt(CentimetersToPoints(2)) Then WordFS = WordFS + 0.25
If CInt(.LeftMargin) = CInt(CentimetersToPoints(2.5)) Then WordFS = WordFS + 0.25
If CInt(.RightMargin) = CInt(CentimetersToPoints(2)) Then WordFS = WordFS + 0.25
If .MirrorMargins = True Then WordFS = WordFS + 1
End With
'第4题评分
.Select
With Selection.Find
.Text = "拐上起飞跑道"
.Execute
End With
n = Selection.Start
.Select
With Selection.Find
.Text = "良好局面。"
.Execute
End With
m = Selection.End
Dim rngDOc As Range
Set rngDOc = .Range(n, m)
With rngDOc.ParagraphFormat
If CInt(.LineSpacing) = CInt(LinesToPoints(1.2)) Then WordFS = WordFS + 0.5
If .CharacterUnitFirstLineIndent = 2 Then WordFS = WordFS + 1
If .LineUnitAfter = 0.5 Then WordFS = WordFS + 0.5
End With
Set rngDOc = Nothing
'第5题评分
n = .Tables.Count
If n = 1 Then
Dim rn As Paragraph
Dim DocTab As Table
Set DocTab = .Tables(1)
If DocTab.Columns.Count = 4 And DocTab.Rows.Count = 3 Then WordFS = WordFS + 1 '表格三行四列正确
If DocTab.Columns(1).Width = 56.7 And DocTab.Columns(2).Width = 56.7 Then WordFS = WordFS + 0.5 ' "第1 2列宽为2厘米"
If DocTab.Columns(3).Width = 85.05 And DocTab.Columns(4).Width = 85.05 Then WordFS = WordFS + 0.5 ' "第3 4列宽为3厘米"
If DocTab.Rows.Alignment = wdAlignRowCenter Then WordFS = WordFS + 0.5 ' "表格居中对齐正确"
If DocTab.Range.Paragraphs.Alignment = wdAlignRowCenter Then WordFS = WordFS + 0.5 '表格内文字居中"
Set rn = Nothing
Set DocTab = Nothing
End If
'第6题评分
If .Shapes.Count = 1 Then
If CInt(.Shapes(1).Height) = 142 And CInt(.Shapes(1).Width) = 214 Then WordFS = WordFS + 2 '图片插入正确
.Shapes(1).RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.Shapes(1).RelativeVerticalPosition = wdRelativeVerticalPositionPage
If .Shapes(1).Left = wdShapeCenter And .Shapes(1).Top = wdShapeCenter Then WordFS = WordFS + 1 '图片位置设置正确
End If
' 第7题评分
If .Paragraphs(2).Range.ListFormat.ListString = "$" Then WordFS = WordFS + 1 '项目符号字符为$正确
If .Paragraphs(2).Range.ListFormat.ListValue = 1 Then WordFS = WordFS + 1
' MsgBox "编号:" & .Paragraphs(2).Range.ListFormat.ListValue & vbCrLf & "格式:" & .Paragraphs(2).Range.ListFormat.ListString
' 第8题评分 '因为首字下沉后本身就是一个段落
If .Paragraphs(3).DropCap.LinesToDrop = 2 Then WordFS = WordFS + 1 '首字下沉2行
If .Paragraphs(3).DropCap.FontName = "黑体" Then WordFS = WordFS + 0.5 '设置的字体正确
If .Paragraphs(3).DropCap.DistanceFromText = 0 Then WordFS = WordFS + 0.5 '设置的下沉汉了与正文间距为0
End With
Dim fso As New FileSystemObject
If fso.FolderExists(Documents("word.doc").Path & "\sys") Then
Open Documents("word.doc").Path & "\sys\CJword.dat" For Output As #1
Print #1, WordFS
Close #1
Else
MsgBox WordFS
End If
End Sub