Sub 自动编辑附注() Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^p^p" .Replacement.Text = "^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.Execute Replace:=wdReplaceAll Selection.WholeStory Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting ActiveDocument.Content.Find.Execute FindText:=" ",ReplaceWith:="", Replace:=wdReplaceAll Selection.Find.Execute Replace:=wdReplaceAll Selection.Fields.Unlink Dim i% Dim aTable As Table Application.ScreenUpdating = False For Each aTable In ActiveDocument.Tables With aTable.Cell(1, 1).Range Do .Expand wdRow If .Text Like "*[!"& Chr(7) & Chr(13) & " ]*" = False Then .Rows.Delete i = i + 1 Else .Move wdCell End If Loop Until .End = aTable.Range.End End With Next Application.Browser.Target = wdBrowseTable For i = 1 To ActiveDocument.Tables.Count 'For With Selection ActiveDocument.Tables.Item(i).Select With .Shading .Texture = wdTextureNone .ForegroundPatternColor = wdColorAutomatic .BackgroundPatternColor = -603914241 End With With .Borders(wdBorderTop) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderBottom) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderHorizontal) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With With .Borders(wdBorderVertical) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone .Borders.Shadow = False End With With Options .DefaultBorderLineStyle = wdLineStyleSingle .DefaultBorderLineWidth = wdLineWidth050pt .DefaultBorderColor = wdColorAutomatic End With Next i Dim p As Paragraph ActiveDocument.DeleteAllEditableRanges wdEditorEveryone For Each p In ActiveDocument.Paragraphs If p.Range.Information(wdWithInTable) = False Then p.Range.Editors.Add wdEditorEveryone End If Next ActiveDocument.SelectAllEditableRanges wdEditorEveryone ActiveDocument.DeleteAllEditableRanges wdEditorEveryone Selection.Font.Color = wdColorRed End Sub
|