View Single Post
 
Old 02-15-2015, 06:45 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

How about

Code:
Sub Macro1()
Dim oPara As Paragraph
Dim oRng As Range
Dim vWord As Variant
Dim strNew As String
Dim i As Long
    For Each oPara In ActiveDocument.Paragraphs
        Set oRng = oPara.Range
        oRng.End = oRng.End - 1
        oRng.Text = Trim(oRng.Text)
        vWord = Split(oRng.Text, Chr(32))
        strNew = ""
        For i = 0 To UBound(vWord)
            strNew = strNew & Chr(39) & vWord(i) & Chr(39)
            If i < UBound(vWord) Then
                strNew = strNew & Chr(44) & Chr(32)
            End If
        Next i
        strNew = "(" & strNew & "),"
        oRng.Text = strNew
    Next oPara
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote