|
#1
|
|||
|
|||
Another issue
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 |
#2
|
||||
|
||||
In all likelihood, it's because the template the code looks at isn't your's anymore, but the user's.
__________________
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 |