![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi
I am using a small code which sends a reply to a specified sender. I would like to add a line the reply referring to the name of the attachment, if there is one. I also want to add my signature. I have activated the signature in options to be added on a reply, but it doesnt appear. I would prefer if possible, to add the signature via code, rather than it appear on every reply/forward. Anybody?? Code:
Sub IP2(objMsg As MailItem) Dim objReply As MailItem Set objReply = objMsg.Reply objReply.Subject = "Ref your email - " & objReply.Subject objReply.Body = "Your email with attachments has been received" & vbCrLf & vbCrLf & "Thanks" & vbCrLf & "Chris" objReply.Display objReply.Send Set objReply = Nothing End Sub |
Ads |
#2
|
|||
|
|||
![]()
Try the following and let me know if it works:
Code:
Public Sub IP2(oMailItem As Outlook.MailItem) Dim oAttachment As Outlook.Attachment Dim oMail As MailItem Dim str_Body As String str_Body = "Your email with the following attachments has been received:" & vbNewLine & vbNewLine For Each oAttachment In oMailItem.Attachments str_Body = str_Body & oAttachment.DisplayName & vbNewLine Set objatt = Nothing Next str_Body = str_Body & vbNewLine & "Thanks," & vbNewLine & vbNewLine & "Chris" Set oMail = Application.CreateItem(olMailItem) With oMail .To = oMailItem.SenderEmailAddress .Subject = "Ref your email - " & oMailItem.Subject .Body = str_Body '.Display '**THis line is not needed if you are sending the e-mail. .Send End With Set oMail = Nothing End Sub Last edited by NDuarte : May 31st 12 at 10:32 PM. Reason: Put in Code brackets |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rule to auto reply using a dynamic text file as attachment or message body | DF | Outlook - General Queries | 0 | June 29th 07 07:38 PM |
error does not acknowledge POP3 acct. | i_takeuti | Outlook Express | 0 | April 13th 07 04:05 AM |
error does not acknowledge POP3 acct. | i_takeuti | Outlook Express | 0 | April 13th 07 04:04 AM |
error does not acknowledge POP3 acct. | Faith | Outlook Express | 4 | April 13th 07 03:50 AM |
Auto reply using message rules sends as attachment | qersoft | Outlook Express | 3 | May 21st 06 12:13 AM |