View Single Post
 
Old 05-31-2015, 12:57 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,439
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Austin,

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oPar As Paragraph
Dim bStyle As Boolean
Dim oRng As Word.Range
  For Each oPar In Selection.Paragraphs
    bStyle = False
    Select Case True
      Case oPar.LeftIndent > 0.4 And oPar.RightIndent > 0.4: bStyle = True
      Case Asc(oPar.Range.Characters.First) = 34
        Set oRng = oPar.Range
        oRng.Start = oRng.Start + 1
        If InStr(oRng.Text, Chr(34)) = 0 Then
          bStyle = True
        ElseIf InStr(oRng.Text, Chr(34)) = Len(oRng.Text) - 1 Then
          bStyle = True
        End If
      Case Else
        'Do nothing
    End Select
    If bStyle Then oPar.Range.Style = "Quote"
  Next oPar
lbl_Exit:
  Exit Sub
End Sub
There is an old saw that goes "Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime." I realize that you are a novice and I've been giving you several fish. The the process here should be that you first try on your own. If you can't work it out then post your attempt and then ask for assistance. Fair enough?
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote