Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cunixf.cc.columbia.edu!gg2 From: gg2@cunixf.cc.columbia.edu (Guy Gallo) Newsgroups: comp.windows.ms Subject: Re: winword question? Message-ID: <1991May31.062034.26205@cunixf.cc.columbia.edu> Date: 31 May 91 06:20:34 GMT Organization: Columbia University Lines: 43 In article <1991May30.131636.5020@bmers145.bnr.ca> terryc@bnr.ca (Terry Clouthier) writes: > > Can styles apply to text within a paragraph? > For example, I want to create a style for variable names. > This would allow me to change the formatting for all > variables in the document by changing the style. > > If styles can't help is there something less I > can use to accomplish this? Terry, No, you can't define a style within a style. However, you can create a macro to change the character formatting... For instance, I wanted to to precisely the same thing in a documentation file (the main font was Times, and I wanted keywords in Swiss). What follows is a macro that 1) if the selection is a block (a highlighted word), apply Swiss, or 2) if the selection is an insertion point, either turn Swiss on or off: Sub MAIN If SelType() = 2 Then Font "Swiss", 10 Bold 1 Else CharLeft F$ = Font$() CharRight If F$ <> "Swiss" Then Font "Swiss", 10 Bold 1 Else ResetChar End If End If End Sub Another way you can do this in WfW is to do a search and replace for the keyword you want to change, and in the Replace edit box, set the font to whatever you want by cycling through the available fonts (Ctrl-F) or by applying the attribute you want (Ctrl-B, for instance if you want the word replaced as Bold). The Replace function is very powerful. Hope this helps