![]() |
|
#2
|
|||
|
|||
|
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 |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Word Error Message Run time Error 4605 | baes10 | Word VBA | 1 | 08-30-2018 02:37 PM |
5941 error message in macro used in merge
|
moneal62 | Word VBA | 6 | 01-18-2016 07:54 PM |
| Error 5941 when running my macro to auto populate fields throughout the word doc | VBAnovice1 | Word VBA | 2 | 05-26-2015 01:35 AM |
| Run-time error 5941 when deleting a row from a table | jpb103 | Word VBA | 1 | 05-26-2014 07:08 AM |
| Word Visual Basic error - run time error 504 | crazymorton | Word | 11 | 01-13-2012 04:32 AM |