Outlook 2007 E-Mail From Selected Task

Status
Not open for further replies.

LMS

Senior Member
Outlook version
Email Account
Exchange Server
I read about some software that you select a list of tasks, and it creates an new email to the contacts related to the tasks.....but there are other areas that don't make sense to me....

so is there a macro that when I select a task or list of tasks, it creates an email to the contacts of each task, can we do it with a specific email template?

And can each email be to each contact, not all contacts in the same email?

This would be great as usual!!! And I have lots of tasks where would like to send emails to each contact without having to open each contact etc...
 
that is a fairly basic macro - something like this - i can't test it because outlook 2013 doesn't support the contact links.

Public Sub SendTask()
Dim Session As Outlook.NameSpace
Dim currentExplorer As Explorer
Dim Selection As Selection

Dim obj As Object

Dim objMsg As MailItem
Set currentExplorer = Application.ActiveExplorer
Set Selection = currentExplorer.Selection
On Error Resume Next
For Each obj In Selection
If obj.Class = olTask Then
Set objTask = obj

Set objMsg = Application.CreateItem(olMailItem)
With objMsg
.To = objTask.Links
.Subject = objTask.Subject
.BodyFormat = olFormatPlain ' send plain text message

> Body = objTask.Body
.Display

End With

Set objMsg = Nothing
End If
Err.Clear
Next
Set Session = Nothing
Set currentExplorer = Nothing
Set obj = Nothing
Set Selection = Nothing

End Sub
 
Thanks very much...I tried it...and it just creates a new email.....but does not put in the email addresss of the contact related to the task.....and also, if I select two tasks, it creates two new emails...but again, not the email address to of the contacts that are related to each task...

so how do we adjust it? and second, can we put in the form of the email what to use from my email template list?

Thanks so so much!!
 
I change the following at it uses a email template, but not the contact email address yet:

Public Sub SendTask()
Dim Session As Outlook.NameSpace
Dim currentExplorer As Explorer
Dim Selection As Selection
Dim obj As Object

Dim objMsg As MailItem
Set currentExplorer = Application.ActiveExplorer
Set Selection = currentExplorer.Selection

On Error Resume Next

For Each obj In Selection

If obj.Class = olTask Then
Set objTask = obj

Set objMsg = Application.CreateItemFromTemplate("C:\Users\UserName\AppData\Roaming\Microsoft\Templates\emailform1.oft")
With objMsg
.To = objTask.Links
.Subject = "From Name"
.Display
End With
Set objMsg = Nothing
End If

Err.Clear
Next

Set Session = Nothing
Set currentExplorer = Nothing
Set obj = Nothing
Set Selection = Nothing

End Sub
 
Re: 2010 outlook today looks like an empty email box

Just need the .to = Have the email address of the contacts that are in the tasks
 
Re: 2010 outlook today looks like an empty email box

Just need the .to = Have the email address of the contacts that are in the tasks



Can you please explain further here? Not sure what you are stateing.
 
Re: 2010 outlook today looks like an empty email box

The macro you gave me and i put in a email template in it, and when I select one or more tasks, it creates an email for each task, but does not put in the email address in the "To" area of the email. Your code has the words: .To = objTask.Links. But that does not add the email address.
 
Re: 2010 outlook today looks like an empty email box

This is the Contacts field at the bottom of the Task form? That is the links collection.

Try adding this under the set objmsg

Set toTask= objTask.Links(1)

then use

> to = toTask.Item

The above assumes there is only one name in the Contact field. If there are more, this only gets the first one - you'd need to loop through all of the links to get all.
 
Re: 2010 outlook today looks like an empty email box

Thanks much. I tried it and in the place where the email address is supposed to be, the name of the contact and its company name shows up....and then I have to select all those words and somehow it shows you business numbers, fax, an email address, and that you then have to click on the email address to add.it to the To of the email....

So is there away it just puts in the email address automatically as I will have many tasks that I select to create emails to those contacts.
 
Re: 2010 outlook today looks like an empty email box

And also, it's basically showing the email address and the fax number in the list that shows up when you click send.....and then you have to select the email address....so it does not automatically go to the email address.
 
Re: 2010 outlook today looks like an empty email box

Possible update that it only adds the email address?
 
Re: 2010 outlook today looks like an empty email box

As a Reminder: Possible update that it only adds the email address? I have used the code 15 times to use 15 different email templates....so just need to have it go directly to the email address of the contact that comes with the Task that I created...as in a contact I create a Task to that contact
 
Re: 2010 outlook today looks like an empty email box

You accidently posted a message this morning in sara's thread and I moved it to your thread. While I was moving it, sara posted too. It's confusing, I should delete those messages.
 
Re: 2010 outlook today looks like an empty email box

Got it. So can we finish this now as I have a lot to do with it. Thanks much.
 
Re: 2010 outlook today looks like an empty email box

Update maybe?
 
Re: 2010 outlook today looks like an empty email box

Possible update soon?
 
Re: 2010 outlook today looks like an empty email box

This change takes care of it.....To = totask.Item.Email1Address

I will post another question re using the task for purposes of going to the contact again
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
D Outlook 2007 e-mail header- How to set font & font size in received message headers ? Using Outlook 2
C in outlook 2007-Contact Group-One name have 3 mail id-its possible? Using Outlook 3
D Recover deleted Outlook 2007 e-mail account Using Outlook 1
L Outlook 2007 Macro Reply to E-mail Using Outlook 16
L Outlook 2007 Search Through E-Mail Using Outlook 41
R Outlook 2007 junk mail Using Outlook 4
F Using Outlook 2007 as an IMAP Mail Station Without Saving Data Locally Using Outlook 2
L Outlook 2007 Distibution E-mail Structure Using Outlook 5
W Combine Mail Merge to Distribution List with Auto Attachments - Outlook 2007 Using Outlook 1
D Problem with MS mail and outlook 2007 OS Windows 8 Using Outlook 1
D Can't Use Contacts with Mail & iCloud in Outlook 2007 Using Outlook 7
L Outlook 2007 E-Mail Search Using Outlook 9
L Outlook 2007 E-mail Search Using Outlook 19
P help me plase !!! outlook 2007 I can see mail Bcc Using Outlook 1
C MS Mail and Outlook 2007 Using Outlook 3
B Outlook 2007 Mail Accounts Order? Using Outlook 2
L Outlook 2007 - How to remove account without removing mail folders? Using Outlook 4
D Sort e-mail by sender's domain - Outlook 2007 Using Outlook 2
N Providing a reference to incoming mail in outlook 2007 BCM (Business Contact Manager) 2
W Outlook exp. 2007 problems - won't receive new mail Using Outlook 1
A Outlook 2007 Mail Merge not working anymore Using Outlook 1
L How can I delete stationery from Actions, New Mail Message Using in outlook 2007? Using Outlook 6
S Outlook 2007 Macro for replying to an e-mail. Outlook VBA and Custom Forms 1
C Importing emails/contacts to Outlook 2007 from Windows Mail Outlook VBA and Custom Forms 3
C How do I enable a link in an e-mail in Outlook 2007? Using Outlook 4
A How to Sort by Unread and then Read mail in Outlook 2007 Using Outlook 7
D Outlook 2007 Will Not Send Mail From C# Application Outlook VBA and Custom Forms 7
N Automating Outlook 2007 problem with sending mail Outlook VBA and Custom Forms 1
D Disable Junk E-mail Filter in Outlook 2007 Using Outlook 13
X open specific e-mail messages in outlook 2007 c# Outlook VBA and Custom Forms 1
T need help w/ sending an e-mail -- outlook 2007 addin Outlook VBA and Custom Forms 2
B Outlook 2003/2007 and New Mail Desktop Alerts Outlook VBA and Custom Forms 4
D Outlook 2007 Recovering E-Mails Using Outlook 0
W Transfer Outlook 2016 autocomplete file to Outlook 2007 Using Outlook 1
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
S Outlook 2007 crash linked to gdiplus.dll Using Outlook 0
S Outlook 2007 - Automatic purge fail Using Outlook 0
J outlook 2007 doesn't let me choose which .pst to search Using Outlook 2
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
S Verwendung von Outlook 2007 Using Outlook 0
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
S outlook 2007 calendar search Using Outlook 6
B Migrate Outlook 2007 to Office 365 Using Outlook 3
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
R Outlook 2007 only loads some appointments Using Outlook 0
C Move Outlook 2007 to new PC with Outlook 365 Using Outlook 3
J Outlook 2007 Hide Messages Option not Available Using Outlook 2

Similar threads

Back
Top