View Single Post
 
Old 08-19-2012, 11:01 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote