A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

auto reply to acknowledge attachment



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 10th 12, 01:11 AM
wotme wotme is offline
Junior Member
 
First recorded activity at Outlookbanter: Apr 2011
Posts: 1
Default auto reply to acknowledge attachment

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  
Old May 31st 12, 10:29 PM
NDuarte NDuarte is offline
Junior Member
 
First recorded activity at Outlookbanter: May 2012
Posts: 6
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 04:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.