Hi Paul,
Sorry to ask this again, I am just trying to make it work.
Now it is giving the error "Style not found". I thought something should be wrong with the style name, however when I clicked on the Debug, the error was on some other line. See the attached image and code is below
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,Table Grid, Umesh Table"
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