View Single Post
 
Old 12-17-2019, 06:49 AM
Marcel Marcel is offline Windows 10 Office 2016
Novice
 
Join Date: Dec 2019
Posts: 2
Marcel is on a distinguished road
Default

Complete macro:

Private Sub CommandButton1_Click()
CommandButton1.Select
Selection.Delete

' Delinstr Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles( _
"Subtitle Char;4. Instruction heading Char")
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles( _
"Subtitle;4. Instruction heading")
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 4
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles( _
"Subtitle Char;4. Instruction heading Char")
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Click here to enter a start date"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 5
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles( _
"Subtitle Char;4. Instruction heading Char")
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Click here to enter an end date"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.LargeScroll Down:=1
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles( _
"Subtitle Char;4. Instruction heading Char")
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Click here to enter a date."
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

End Sub
Reply With Quote