- Sub aaaa表格转文本()
- Dim t As Table, c As Cell
- For Each t In ActiveDocument.Tables
- With t.Range
- For Each c In .Cells
- With c.Range
- If Len(.Text) = 4 Then .Characters(1).InsertAfter Text:=" "
- End With
- Next
- .Rows.ConvertToText Separator:=wdSeparateByTabs, NestedTables:=True
- .Find.Execute "^p", , , 0, , , , , , "^t", 2
- .ConvertToTable Separator:=wdSeparateByTabs, NumColumns:=10, AutoFitBehavior:=wdAutoFitFixed
- .Rows.ConvertToText Separator:=wdSeparateByTabs, NestedTables:=True
- .Find.Execute "^t", , , 0, , , , , , " ", 2
- .Select
- CommandBars.FindControl(ID:=122).Execute
- CommandBars.FindControl(ID:=123).Execute
- Do While .Text Like "*" & vbCr & vbCr
- .Characters.Last.Delete
- Loop
- If .Text Like "*以下空白?" Then .Find.Execute "( )( )(以下空白)", , , 1, , , , , , "\1(\3)", 2
- End With
- With Selection
- .MoveStart 4, -2
- With .Font
- .Name = "宋体"
- .Size = 10
- End With
- .Range.Find.Execute ":", , , 0, , , , , , ":", 2
- .Characters(1).Select
- .Extend ":"
- .Font.Name = "黑体"
- .Move 4
- .Extend ":"
- .Font.Name = "黑体"
- With .Paragraphs(1).Range
- If .Text Like "*:???" Then .Characters.Last.Previous.InsertBefore Text:=" "
- End With
- End With
- Next
- Selection.HomeKey 6
- ActiveWindow.ActivePane.View.ShowAll = Not ActiveWindow.ActivePane.View.ShowAll
- End Sub
复制代码 |