Outlook

siyat

New Member
Joined
Mar 30, 2011
Messages
48
Hi,

I have a issue, i am getting 100's of mails that i have to send a standrad answer to them.

Is this possible to insert a text to subject and text to the body via VBA code i am very newbie to this VBA world, hope for an answer. :)
And if is it possible to do it via a binding e.g ctrl+q ??
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
hi

are you still looking for a solution ??
 
Upvote 0
ok here is something to get you started, I have left in various options that you can comment out and cutomise as you wish, these include the following

1) use the original subject of the incoming email as subject for reply
2) include in the reply the date and time and body of original email in the body along with your new text
3) include an attachment to the reply
4) send on behalf of another mailbox, useful for departmental usage
5) set the message status of the original email to completed

comment out the bits you dont need and change the email body text as required

please take into account that rpl refers to reply and msg refers to original message

Will the reply be sent by yourself or on behalf of team mailbox

you will need to save the following code within your outlook session and assign a shortcut key or a button on the toolbar

The way to use this is to select with the mouse all of the emails in the inbox or folder you wish to reply to, and then hit your button

it will process all in the selection and leave them where they are, you will need to then move them to a folder of your choice

Code:
'****
' Quick macro to take a selection of emails selected by mouse
' with this selection reply to each with the following
'
' 1) use the subject of original in reply
' 2) attach a standard file (PDF)
' 3) include a standard body of text
' 4) reply on behalf of AUC department
' 5) send the reply
'
' Author        Jim Ward

'****

Sub ReplyToSelectionWithAttach2()

'
' Declare objects and variables we need
'
Dim myOlSel As Outlook.Selection
Dim olExp, olCurrentFolder
Dim msg As Outlook.MailItem
Dim rpl As Outlook.MailItem

Dim strMailBody As String

'
' setup what we require
'

Set olExp = Outlook.ActiveExplorer
Set olCurrentFolder = olExp.CurrentFolder
Set myOlSel = olExp.Selection

'
' Process each message selected
' Modify the subject add attachment send reply
'

strMailBody = "Dear Sender" & vbCrLf & vbCrLf
strMailBody = strMailBody & "Thank you for your email" & vbCrLf & vbCrLf
strMailBody = strMailBody & "As you might imagine, we are very busy at the moment." & vbCrLf & vbCrLf
strMailBody = strMailBody & "If you have any further questions please call our advice line on: 0123 456 7890." & vbCrLf & vbCrLf
strMailBody = strMailBody & "Yours sincerely" & vbCrLf & vbCrLf & vbCrLf
strMailBody = strMailBody & "Claims Handling Team"

For Each msg In myOlSel
    Set rpl = Application.CreateItem(olMailItem)
    rpl.To = msg.SenderEmailAddress
'    rpl.Subject = msg.Subject
'    rpl.Subject = "<<<< put your own subject here >>>> or use the original subject as subject"
    rpl.SentOnBehalfOfName = "claims"
'    rpl.Body = strMailBody & vbCrLf & vbCrLf & "Original Email Received :- " & msg.ReceivedTime & vbCrLf & vbCrLf & msg.Body
    rpl.Body = strMailBody
'    rpl.Attachments.Add "H:\complaints\standard_reply.pdf"
    rpl.Display
'    rpl.Send

    msg.FlagStatus = olFlagComplete
    msg.Save

    Set msg = Nothing
    Set rpl = Nothing
Next
MsgBox "All emails sent, please move these to required Folder"

End Sub
 
Upvote 0
Omg thank you very much but one more thing.
Is this possible that if i have to send like 200 mails a day with the same text, that i have in a word document and it copy it from the document and insert it to the body inted og attached?

Sorry that i am asking so much :(
 
Upvote 0
ok, i need a bit more information for testing, can you provide the following

1) what will be the rough layout of your reply here is my guess

Dear Sender
>>> pasted data from word doc here <<<<<
Kind Regards The team

Without being too fancy, a lot will depend on how you have outlook configured to send emails in a particular format, whether it be text or HTML

in its simplest form, you could follow this suggested process

1) open up word doc, select and copy text
2) highlight emails in outlook that you wish to reply to
3) execute macro
macro will paste your data into body of email
reply with same email to all emails selected
4) allow you to move emails to another folder with selection still enabled
 
Upvote 0
Thank you so much for your reply.

I am sorry for my poor english, but i will try to explain my self.

The solution I seek is that when I reply or send a new text that you should be able to paste this text from word file.

I can explain you the whole procedure:

I work in a telephone company, where customers they sign up for a data solution and I receive their information and their email as a mini template and their email as a link in the mail that comes from our register entry system.

I click on their email that opens a new mail and then they must have the text from word file, I have about 200 of the mails a day and it is about to kill me. :(

So it will make it a little easier for me that after I click on their email and opens a new email and I'll could press Ctrl + Q to run the macro and paste text from Word documenten as email and change the subject line to internet.

That is basically what I want. I dont know if this is possible?:)

Thank you for taking the time to help me with this.


PS: If you want to see how much text i have in world file i can send you the file so you can see, it is one page of text.
 
Upvote 0
hello again, where in the world are you based ??

is the word file specific for the user, or is it the same text for all users

why cant the word document be attached to the return email, if this was the case then all formatting would be retained and the user can print off etc etc at their end

if the word doc is specific for a user, is it stored in a folder.

I am not quite sure I am understanding your current process, sorry
 
Upvote 0
Hello,

I am from Denmark and let me explain the process :)


When new costumer buy subscibtion from us we recieve a mail.
That looks kind og like this


Name: Peter Petersen
Adresse: Østerbrogade 12
Post nr: 2200 København Ø
Email: peter.petersen@hotmail.com
and etc.

1. When i recieve them as a smal template so i click on the email link.
2. A new mail opens up to peter.petersen@hotmail.com
3. Then i write Internet in subject
4. The i copy the word file context to the new mail that instruct them in how to activate and the basic contact information for our company and etc.
5. I Send them and flag them as sent.

And i get like 200 mails a day and i am doing that every day.
So i was hoping that some how i could make that easier then now insted of all this copy paste and doing the same over and over again the whole day.

Does this helped? :)

Thank you for your help :)
 
Upvote 0

Forum statistics

Threads
1,225,611
Messages
6,185,996
Members
453,334
Latest member
Prakash Jha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top