![]() |
|
#19
|
||||
|
||||
|
I have no idea whay your code might have stopped working. Have you tried re-starting Word?
FWIW, the code you posted could be reduced to: Code:
Sub Document_Open()
Dim StrSty As String, i As Long
StrSty = "Custom Breakout,Custom Breakout Subheading,Custom Page Heading," & _
"Custom Page Subheading 1.0,Umesh Table Style"
With ActiveDocument
With .Content.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Text = "monitor"
.Replacement.Text = "review"
.Execute Replace:=wdReplaceAll
.Text = "folder or on a seperate disc"
.Replacement.Text = "folder"
.Execute Replace:=wdReplaceAll
End With
If InStr(.Sections.First.Footers(wdHeaderFooterFirstPage).Range.Text, "Statement of Advice") > 0 Then
For i = 0 To UBound(Split(StrSty, ","))
Application.OrganizerCopy Source:=.AttachedTemplate.FullName, Destination:=.FullName, _
Name:=Split(StrSty, ",")(i), Object:=wdOrganizerObjectStyles
Next
End If
End With
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Create and save custom heading style
|
ubns | Word | 3 | 08-01-2012 09:42 PM |
Modify a numbered heading style
|
TheQueenBea | Word | 3 | 06-05-2012 12:12 PM |
Changing numbering in a Heading style
|
TheQueenBea | Word | 1 | 05-31-2012 02:22 PM |
Very frequent heading style, but still not built in Word!!!!! why???
|
Jamal NUMAN | Word | 17 | 06-30-2011 05:47 PM |
| How to have this Heading – Table of contents style? | Jamal NUMAN | Word | 0 | 01-13-2011 06:02 PM |