Forums

Discuss all things Remember The Milk.

Tip: Quickly add RTM from Outlook mails

aartnicolai says:
The problem:
Every now and then I want to add a task in RTM after sending an e-mail to someone in order to remind myself. I noticed when I CC my personal RTM e-mails address in the e-mail and update the subject accordingly with the required tags, people start asking questions just because they don't understand these tags. Image you receive an e-mail containing tags like "^tomorrow #wait_for" etc..

Solution:
In order to fix this I have created a small macro in Outlook. This macro is on top of every e-mail I send and pulls out the subject of the e-mail. The only you have to do is to change the suggested RTM tags like due date or list.
I noticed this way adding tasks goes much quicker.

Here you find the code and below the implementation guide:

Code:
Sub ForwardToRTM()
Dim objMail As Outlook.MailItem

Set objItem = GetCurrentItem()
Set objMail = objItem.Forward
objMail.DeleteAfterSubmit = True
objMail.To = "[YOUR_RTM_EMAIL_ADDRESS]"
objMail.Subject = Replace(objMail.Subject, "FW: ", "")
objMail.Subject = Replace(objMail.Subject, "Re: ", "")
objMail.Subject = InputBox(prompt:="Enter the subject.", Title:="RTM Task", Default:=objMail.Subject & " ^tomorrow")

objMail.Send
objItem.Delete
Set objItem = Nothing
Set objMail = Nothing
End Sub
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = Application
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
End Select
End Function

Implementation guide:
1. Go to the Developer ribbon in Outlook;
2. Click on Macros and then Macros;
3. Copy and paste the code from above and update the e-mail address section;
4. Save the macro;
5. Open a new e-mail message and click on the very top of the message on the little dropdown box "Customize Quick Access Toolbar".
6. Click on "More commands"
6. Choose from the "Choose commands from:" dropdown box Macros;
7. Select "ForwardToRTM" and click "Add"
8. Now you have the button on top of every every e-mail. Click the button just before sending an e-mail, but afterwards is possible as well.

Have fun
Posted at 9:01am on March 5, 2014
techlifeweb says:
Thanks. This is what I needed to get started. I added a couple features.

I always use a standard set of tags so now I'm just prompted with the subject line to edit and I won't accidentally delete my standard tags. Also, I always begin my work tasks with the date so they sort oldest to newest instead of alphabetical. This way I know instantly how old something is if I didn't get to it right away.

Also, this now strips attachments before sending. I needed to follow up on an email that had lots of attachments and it was bounced by RTMs email servers. This fixes that. It doesn't delete the attachments in the original email.

Third, I commented out deleting the original mail. I usually still need this around though I move them from my inbox.

My code follows. Hopefully the comment box won't chew it up.

-------------------------------

Sub ForwardToRTM()
'From https://www.rememberthemilk.com/forums/tips/18090/
Dim objMail As Outlook.MailItem
Dim myattachments As Outlook.Attachments

Set objItem = GetCurrentItem()
Set objMail = objItem.Forward
objMail.DeleteAfterSubmit = True
objMail.To = "YOUR_RTM_EMAIL_ADDRESS]"
objMail.Subject = Replace(objMail.Subject, "FW: ", "")
objMail.Subject = Replace(objMail.Subject, "Re: ", "")
objMail.Subject = InputBox(prompt:="Enter the subject.", Title:="RTM Task", Default:=objMail.Subject)
objMail.Subject = Year(objItem.ReceivedTime) & Month(objItem.ReceivedTime) & Day(objItem.ReceivedTime) & " " & objMail.Subject & " #Central #.wk #next @Work"

Set myattachments = objMail.Attachments
While myattachments.Count > 0
myattachments.Remove 1
Wend

objMail.Send
'objItem.Delete
Set objItem = Nothing
Set objMail = Nothing
End Sub
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = Application
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
End Select
End Function
Posted 9 years ago
Log in to post a reply.