Единственное на что меня хватило это вот:
Sub Макрос1()
'
' Макрос1 Макрос
' Макрос записан 28.12.2010 Admin
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Точки подключения соответствующие объектам"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
1: Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveUp Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
If Selection.Columns.Count = 1 Then
GoTo 2
End If
Selection.Cells.Merge
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
Selection.MoveDown Unit:=wdLine, Count:=1
If Selection.Find.Execute = True Then
GoTo 1
End If
2:
Dim oTbl As Table
Dim oCll As Cell
For Each oTbl In ActiveDocument.Tables
For Each oCll In oTbl.Range.Cells
If Len(oCll.Range.Text) = 2 Then
oCll.Range.Text = "0,000"
End If
Next
Next
For Each oTbl In ActiveDocument.Tables
Selection.Find.ClearFormatting
With Selection.Find
.Text = "1 квартал"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=2
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "газ на"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "газ на"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Next
End Sub
Отредактировано gaddenis (09.03.2011 07:26:43)