SHARE
TWEET

Restyling Bibliography in VBA

charlesweir Apr 23rd, 2020 475 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub RestyleBibliography()
  2. '
  3. ' Changes the style of text within the 'Bibliography' bookmark to 'Bibliography'.
  4. '
  5.    ' If there's no Bibliography style or bookmark, skip this (though actually I think Bibliography may be a built-in style)
  6.    On Error GoTo ExitSub
  7.     BibliographyStyle = ActiveDocument.Styles("Bibliography")
  8.     With ActiveDocument.Bookmarks("Bibliography").Range
  9.         .Select
  10.         Selection.ClearParagraphDirectFormatting
  11.         .style = BibliographyStyle
  12.     End With
  13.  
  14. ExitSub:
  15.     On Error GoTo -1 ' VBA Magic to reset error handling
  16. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top