Very rough, written in VB6, but there should be enough for you to work with for your own purposes.
Code:
Private Sub Command1_Click()
MsgBox p("1,3,5,7")
End Sub
Private Function p(s As String) As String
Dim a() As String
Dim i As Integer
Dim j As Integer
Dim r As String
a = Split(s, ",")
For i = 0 To UBound(a) - 1
For j = i + 1 To UBound(a)
r = r & zp(a(i)) & zp(a(j)) & vbCrLf
Next j
Next i
p = r
End Function
Private Function zp(s As String) As String
If Len(s) = 1 Then
zp = "0" & s
Else
zp = s
End If
End Function