Sub Выделить_между()
Dim MyRange As Range, rStart&, rEnd&
Set MyRange = ActiveDocument.Content
With MyRange
With .Find
.ClearFormatting
.Text = "Структура активов"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
If .Found Then rStart = MyRange.End: rEnd = rStart
End With
End With
Set MyRange = ActiveDocument.Content
With MyRange
With .Find
.Text = "Внеоборотные активы"
.Execute
If .Found Then rEnd = MyRange.Start
End With
End With
If rEnd > rStart Then
ActiveDocument.Range(rStart, rEnd).Select
Selection.Copy
End If
End Sub
Sub Выделить_между2()
Dim r
Set r = ActiveDocument.Range
With r.Find
.ClearFormatting
.Text = "Структура активов*Внеоборотные активы"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
If .Execute Then
ActiveDocument.Range(r.Start + 4, r.End - 4).Select
Selection.Copy
Else
MsgBox "Текст не найден!", vbExclamation
End If
End With
End Sub
Sub Макрос1()
'
' Макрос1 Макрос
For Each dd In ActiveDocument.Tables
asq = asq + 1
dd.Name
Next
End Sub |
Sub Выделить_между()
Dim MyRange As Range, rStart&, rEnd&
Set MyRange = ActiveDocument.Content
With MyRange
With .Find
.ClearFormatting
.Text = "Структура активов"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
If .Found Then rStart = MyRange.End: rEnd = rStart
End With
End With
Set MyRange = ActiveDocument.Content
With MyRange
With .Find
.Text = "Внеоборотные активы"
.Execute
If .Found Then rEnd = MyRange.Start
End With
End With
If rEnd > rStart Then
ActiveDocument.Range(rStart, rEnd).Select
Selection.Copy
End If
End Sub
Sub Выделить_между2()
Dim r
Set r = ActiveDocument.Range
With r.Find
.ClearFormatting
.Text = "Структура активов*Внеоборотные активы"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
If .Execute Then
ActiveDocument.Range(r.Start + 4, r.End - 4).Select
Selection.Copy
Else
MsgBox "Текст не найден!", vbExclamation
End If
End With
End Sub
Sub Макрос1()
'
' Макрос1 Макрос
For Each dd In ActiveDocument.Tables
asq = asq + 1
dd.Name
Next
End Sub