Can someone re-post the complete, corrected code? I would like to direct my blog readers to this great macro. (Also, Bill has anything new happened on your Web site? I'd be happy to direct people there, too.)
Sub AtWaitingForTasksFromEmail()
' Comments :
' Parameters: -
' Modified :
'
' --------------------------------------------------
Dim objTask As Outlook.TaskItem
Dim objApp As Outlook.Application
Dim objCurrentItem As Object
Dim objRecips As Outlook.Recipients
Dim objRecip As Outlook.Recipient
Set objApp = Outlook.CreateObject("Outlook.Application")
Set objCurrentItem = GetCurrentItem()
If objCurrentItem.Class = olMail Then
Set objRecips = objCurrentItem.Recipients
For Each objRecip In objRecips
If objRecip.Type = olTo Then
Set objTask = objApp.CreateItem(olTaskItem)
objTask.Attachments.Add objCurrentItem
objTask.Subject = objRecip & " - " & objCurrentItem.Subject & " " & Format(Now, "mm.dd.yy")
objTask.ReminderSet = True
objTask.ReminderTime = DateAdd("d", 7, Now)
objTask.Categories = "@WaitingFor"
objTask.Display
objTask.Save
End If
Next
Else:
MsgBox "Oops!!! This macro only works with Mail Items."
Exit Sub
End If
End Sub
Function GetCurrentItem() As Object
' Comments :
' Parameters: -
' Returns : Object -
' Modified :
'
' --------------------------------------------------
Dim objApp As Application
Dim objSel As Selection
Dim objCurrentItem As Object
Set objApp = CreateObject("Outlook.Application")
Select Case objApp.ActiveWindow.Class
Case olExplorer
Set objSel = objApp.ActiveExplorer.Selection
If objSel.Count > 0 Then
Set objCurrentItem = objSel.Item(1)
End If
Case olInspector
Set objCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
End Select
Set GetCurrentItem = objCurrentItem
Set objCurrentItem = Nothing
Set objSel = Nothing
Set objApp = Nothing
End Function
Michael Hyatt said:Can someone re-post the complete, corrected code? I would like to direct my blog readers to this great macro. (Also, Bill has anything new happened on your Web site? I'd be happy to direct people there, too.)
ameasha said:Brian:
Thank you! I'd like to take the attachment off altogether. Do you think removing this line would do the trick?
Code:objTask.Attachments.Add objCurrentItem
Thanks!
Amanda
ameasha said:Yes, but I hadn't actually noticed that until you pointed it out
Do you know how we can add the headers too?
Thank you!
Amanda
Do you know how we can add the headers too?
objTask.Body = objCurrentItem.Body
bdavidson said:Michael Hyatt said:Can someone re-post the complete, corrected code? I would like to direct my blog readers to this great macro. (Also, Bill has anything new happened on your Web site? I'd be happy to direct people there, too.)
I have also edited my original message to include all the edits I've made to my offshoot of Bill's original code.
Try altering your Security settings. Tools, Macro, Security, then set to Medium. You are probably at high or very high currently.lhuney1034 said:Hey Bill,
Any suggestion on how to get macros enabled as I continually get message "Macros are not enabled for this application". I'm sure this is a simple fix of which I'm not aware. Thanks for any help.
H