Hi. I have the following statement in my code: If InStr(Selection.Style.NameLocal, "Body Text") > 0 Then ...etc. I have a number of styles with the prefix Body Text but want to exclude "Body Text 3" from this statement. Is there any code I can add to the above line? Many thanks, Matt
If (InStr(Selection.Style.NameLocal, "Body Text") > 0) _ And (Selection.Style.NameLocal <> "Body Text 3") Then Be sure to include a space character before the line-continuation underscore. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Fri, 31 Aug 2007 18:15:11 -0000, Matt C wrote: >Hi. I have the following statement in my code: > >If InStr(Selection.Style.NameLocal, "Body Text") > 0 Then > >...etc. > >I have a number of styles with the prefix Body Text but want to >exclude "Body Text 3" from this statement. > >Is there any code I can add to the above line? > >Many thanks, Matt