View Single Post
  #4   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Greg Maxey
 
Posts: n/a
Default Replacing style of the first word of a paragraph only

Try:

Sub Test()
Dim oPar
For Each oPar In ActiveDocument.Paragraphs
oPar.Range.Words.First.Select
Selection.Style = ActiveDocument.Styles("Heading 1 Char")
Next
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

homeologica wrote:
Thanks Greg. I need to change the style because headings must have
StyleRef DefinedStyle. Only First words must appear in this Headings