Code: Select all
Sub MakeLoungeList()
Dim oPara As Paragraph
Dim iResp As VbMsgBoxResult
iResp = MsgBox("Click 'Yes' to convert selected text to a bulleted list. " & vbNewLine & _
"Click 'No' to convert selected text to a numbered list.", vbYesNoCancel + vbQuestion)
If iResp = vbCancel Then Exit Sub
On Error GoTo ErrHandler
Selection.Expand Unit:=wdParagraph
For Each oPara In Selection.Paragraphs
oPara.Range.InsertBefore "[*]"
Next oPara
If iResp = vbYes Then
Selection.InsertBefore "[list]"
Else
Selection.InsertBefore "[list=1]"
End If
Selection.InsertAfter "[/list]"
Selection.Copy
Exit Sub
ErrHandler:
MsgBox Err.Description, vbExclamation
End Sub
Usage instructions:
- Select text in Word that you want to post as a list in a post.
- Press Alt+F8 to display the Macros dialog.
- Select MakeLoungeList.
- Click Run.
- Click Yes for a bulleted list, No for a numbered list.
The BBCode for the list will be copied to the clipboard, ready to be pasted into a post.
Thanks for this macro, Rudi!