Hello, I want to insert greeting in reply message.
Sub a1()
'Now Time
Dim st As String
F3 = Format(Time, "h")
'MsgBox (F3)
'============
Select Case F3
Case Is >= 18
st = "Good evening, "
Case Is >= 10
st = "Good day, "
Case Is >= 6
st = "Good morning, "
End Select
'============
' Reply all
Dim o As MailItem
Set o = Application.ActiveExplorer.Selection.Item(1)
o.ReplyAll.Display
' get recipient name
Komy = o.Recipients.Item(1)
' If 0 - an error with massive.
' If 1 - I get my name, but not a name of recipient.
' If there are a few recipients and I use (2) - I get the name of second recipient.
'============
' I want to insert "Good evening, %Komy%" in the begin of letter.
' How to do it? Now I can only display message box:
MsgBox (st & Komy)
End Sub
Please help.
Sub a1()
'Now Time
Dim st As String
F3 = Format(Time, "h")
'MsgBox (F3)
'============
Select Case F3
Case Is >= 18
st = "Good evening, "
Case Is >= 10
st = "Good day, "
Case Is >= 6
st = "Good morning, "
End Select
'============
' Reply all
Dim o As MailItem
Set o = Application.ActiveExplorer.Selection.Item(1)
o.ReplyAll.Display
' get recipient name
Komy = o.Recipients.Item(1)
' If 0 - an error with massive.
' If 1 - I get my name, but not a name of recipient.
' If there are a few recipients and I use (2) - I get the name of second recipient.
'============
' I want to insert "Good evening, %Komy%" in the begin of letter.
' How to do it? Now I can only display message box:
MsgBox (st & Komy)
End Sub
Please help.