View Single Post
 
Old 10-30-2014, 11:43 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

It works for me, with character and paragraph Styles alike. Indeed, you could even simplify the line to:
.Style = "DB_Content"

Do note that, apart from any paragraph-level attributes applied by your Style (e.g. alignment, space before/after, font name & size), hyperlinks have their own character Styles (basically, blue underlined text), so those will take precedence over your Style. You can, of course, re-apply the Style's font attributes such as bold & italics to the paragraph, so as to re-format the hyperlinks, after applying the Style, using code like:
Code:
  With .Paragraphs(1).Range.Font
    .Bold = ActiveDocument.Styles("DB_Content").Font.Bold
    .Italic = ActiveDocument.Styles("DB_Content").Font.Italic
  End With
before the 'End With'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote