Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Fri, 31 Aug 2007 18:15:11 -0000,    group: microsoft.public.word.word97vba        back       


"If" statement and Paragraph Styles   
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
date: Fri, 31 Aug 2007 18:15:11 -0000   author:   Matt C

Re: "If" statement and Paragraph Styles   
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
date: Fri, 31 Aug 2007 14:48:31 -0400   author:   Jay Freedman

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us