|
- Sub aaaa班号分配()
- Dim i$, j$
- ActiveDocument.Tables(1).Cell(2, 1).Select
- j = 1
- With Selection
- Do
- .MoveEnd unit:=wdCharacter, Count:=-1
- i = .Text
- If i <> j Then
- j = i
- .InsertBreak
- .Next(4, 1).Select
- Else
- .Next(4, 6).Select
- If Not .Information(12) Then Exit Do
- End If
- Loop
- .HomeKey unit:=wdStory
- With .Find
- .ClearFormatting
- Do While .Execute("^12^13", , , 1, , , 1)
- With .Parent
- .Font.Size = 1
- With .ParagraphFormat
- .LineSpacing = LinesToPoints(0.06)
- .AutoAdjustRightIndent = False
- .DisableLineHeightGrid = True
- End With
- End With
- Loop
- End With
- End With
- ActiveDocument.PageSetup.TextColumns.Add Width:=CentimetersToPoints(6.95), _
- Spacing:=CentimetersToPoints(0.75), EvenlySpaced:=False
- '
- Dim t As Table
- For Each t In ActiveDocument.Tables
- t.Rows(1).Select
- Selection.Font.Bold = True
- With Selection
- .InsertRows 1
- .Rows.HeadingFormat = True
- .TypeText Text:="班号"
- .MoveRight unit:=wdCell
- .TypeText Text:="姓名"
- .MoveRight unit:=wdCell
- .TypeText Text:="考号"
- .MoveRight unit:=wdCell
- .TypeText Text:="考场"
- .MoveRight unit:=wdCell
- .TypeText Text:="座号"
- End With
- Next
- ActiveDocument.Tables(1).Rows(2).Delete
- Selection.HomeKey unit:=wdStory
- MsgBox "OK"
- End Sub
复制代码 |
|