Forums

Discuss all things Remember The Milk.

Creating New Tasks and Forwarding Emails From Outlook

veevandyke says:
I have written a little macro in Outlook that I use to forward salient emails into RTM as tasks. I also create a "create RTM" macro that sends an email with your stuff into RTM, however, I use that less.

NOTE: You must have macros enabled in Outlook for this to work:

Here is how to do it:

1. Go into Outlook and select Tool->Macros->Visual Basic Editor.
2. Create a New Module (you can call it anything you like.)

3. Paste in the following code:

================================================

Const strTo As String = "***PUT MY RTM ADDRESS HERE***@rmilk.com"

Public Sub MilkNew()
On Error GoTo err_MilkNew

Dim olItem As Outlook.MailItem
Set olItem = Application.CreateItem(0)

Dim strSubject As String
Dim strBody As String

strBody = "Location: " & vbCr & strBody
strBody = "URL: " & vbCr & strBody
strBody = "List: " & vbCr & strBody
strBody = "Due: " & vbCr & strBody
strBody = "Priority: " & vbCr & strBody
strBody = "Repeat: " & vbCr & strBody
strBody = "Estimate: " & vbCr & strBody
strBody = "Tags: " & vbCr & strBody


strBody = strBody & vbCr & "---" & vbCr


With olItem
.To = strTo

.Body = strBody
.Subject = InputBox("Enter Task")
.Display

End With

Set olItem = Nothing

exit_MilkNew:
On Error Resume Next
Exit Sub

err_MilkNew:
Select Case Err.Number
Case Else
MsgBox Err.Description
Resume exit_MilkNew
End Select

End Sub


Public Sub MilkForward()
On Error GoTo err_MilkForward

Dim myForward As Outlook.MailItem
Dim colSelection As Outlook.Selection
Dim forwardTo As String

Dim strBody As String
Dim strOrigBody As String


strBody = "Location: " & vbCr & strBody
strBody = "URL: " & vbCr & strBody
strBody = "List: " & vbCr & strBody
strBody = "Due: " & vbCr & strBody
strBody = "Priority: " & vbCr & strBody
strBody = "Repeat: " & vbCr & strBody
strBody = "Estimate: " & vbCr & strBody
strBody = "Tags: " & vbCr & strBody
strBody = strBody & vbCr & "---" & vbCr

Set colSelection = Application.ActiveExplorer.Selection

If colSelection.Count = 0 Then
Set colSelection = Nothing
Exit Sub
End If
' Forward to

forwardTo = strTo
Set myForward = colSelection.Item(1).Forward

myForward.Recipients.Add forwardTo
strOrigBody = myForward.Body
'this part removes the automatic signature if you have one set
strOrigBody = Mid(strOrigBody, InStr(1, strOrigBody, "From"))
myForward.Body = strBody & vbCr & strOrigBody
myForward.Display

Set colSelection = Nothing

exit_MilkForward:
On Error Resume Next
Exit Sub

err_MilkForward:
Select Case Err.Number
Case Else
MsgBox Err.Description
Resume exit_MilkForward
End Select
End Sub

================================================

4. Save the code (Duh.)
5. Go back into the main Outlook screen, and Right Click anywhere on your menu, and select Customize.
6. In the box that appears, select Macros. You should see two new macros: MilkNew and MilkForward. Drag and drop them anywhere on your menu bar.
7. For a new RTM task, just click new. It opens a blank email with all the various items that you can enter for RTM in there. To forward an email task to RTM, select an email in the list and click RTMForward.

Voila.

It's not Outlook Synchronization (for which I am NOT patiently waiting...) but at least it gets stuff into RTM easily FROM Outlook.
Posted at 12:12pm on July 24, 2009
rob.dexter says:
Brilliant! This is awesome.
Posted 14 years ago
Log in to post a reply.