Hi Experts,

I found the below Vba Code for Inserting name in reply or inserting
greeting in reply automatically.

Sub InsertNameInReply() Dim Msg As Outlook.MailItem Dim MsgReply
AsOutlook.MailItem
Dim strGreetName As String Dim lGreetType As Long ' set reference to
open/selected mail item On Error Resume Next Select
CaseTypeName(Application.ActiveWindow)
Case "Explorer" Set Msg = ActiveExplorer.Selection.item(1) Case "Inspector"
Set Msg = ActiveInspector.CurrentItem Case Else End Select On Error Goto 0
If Msg Is Nothing Then Goto ExitProc ' figure out greeting line On Error
Resume Next lGreetType = InputBox("How to greet:" & vbCr & vbCr & "Type '1'
for name, '2' for time of day") On Error Goto 0 If lGreetType = False Then
Goto ExitProc If lGreetType = 1 Then strGreetName = Left$(Msg.SenderName,
InStr(1, Msg.SenderName, " ") - 1) ElseIf lGreetType = 2 Then Select CaseTime
Case Is < 0.5 strGreetName = "Good morning" Case 0.5 To 0.75 strGreetName =
"Good afternoon" Case Else strGreetName = "Good evening" End Select Else '
something else entered?? Goto ExitProc End If Set MsgReply = Msg.Reply
WithMsgReply .Subject = "RE:" & Msg.Subject .HTMLBody = "<span
style=""font-family : verdana;font-size : 10pt""><p>Hello " & strGreetName
& ",</p></span>" & .HTMLBody .Display End With ExitProc: Set Msg = Nothing
Set MsgReply = Nothing End Sub

But actually I am looking for insertion of both ie Name as well as
greetings automatically.

Please help on it.

Regards,
Kaushik Savla

-- 
FORUM RULES (934+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to