- Sub a1219_PayTable()
- Dim i As Paragraph
- With ActiveDocument
- With .Content.Find
- .Execute "身份证号:", , , 0, , , , , , "^p^&", 2
- .Execute ",", , , 0, , , , , , ",", 2
- .Execute ",^p", , , 0, , , , , , "^p", 2
- End With
-
- For Each i In .Paragraphs
- If Asc(i.Range) = 13 Then i.Range.Delete
- Next
-
- .Select
- Selection.ConvertToTable Separator:=wdSeparateByCommas, NumColumns:=4, AutoFitBehavior:=wdAutoFitFixed
- Selection.Tables(1).Style = "网格型"
-
- With .Content.Find
- .Execute "身份证号:", , , 0, , , , , , "", 2
- .Execute "姓名:", , , 0, , , , , , "", 2
- .Execute "薪资月份:", , , 0, , , , , , "", 2
- .Execute "发薪金额:", , , 0, , , , , , "", 2
- End With
-
- With .Tables(1).Rows(1)
- .Select
- Selection.InsertRowsAbove 1
- End With
-
- With .Tables(1).Rows(1)
- .Cells(1).Range.Text = "身份证号": .Cells(2).Range.Text = "姓名": .Cells(3).Range.Text = "薪资月份": .Cells(4).Range.Text = "发薪金额"
- With .Range.Font
- .Name = "黑体"
- .Bold = True
- End With
- End With
- End With
- End Sub
复制代码 |