If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Task Attachments Are Not Being Displayed
Hi I have a program (thanks to Sue Mosher) that converts emails into tasks,
based on certain words in the subject line. It runs as an Outlook Rule. It works fine except for the attachments. For some reason the attachments that are being sent are not being displayed in the task that is generated. Here is my code: Sub MakeTaskFromMail(MyMail As Outlook.MailItem) Dim strID As String Dim olNS As Outlook.NameSpace Dim olMail As Outlook.MailItem Dim objTask As Outlook.TaskItem strID = MyMail.EntryID Set olNS = Application.GetNamespace("MAPI") Set olMail = olNS.GetItemFromID(strID) Set objTask = Application.CreateItem(olTaskItem) With objTask .Subject = olMail.Subject .DueDate = DateAddW(olMail.SentOn, 5) .ReminderTime = DateAddW(olMail.SentOn, 4) .Importance = olImportanceHigh .Body = olMail.Body .Attachments = olMail.Attachments -WHERE I'M HAVING TROUBLE! End With olMail.Delete objTask.Save Set objTask = Nothing Set olMail = Nothing Set olNS = Nothing End Sub If any one can help here, it would be great! |
Ads |
#2
|
|||
|
|||
Task Attachments Are Not Being Displayed
Am Wed, 16 Aug 2006 19:02:01 -0700 schrieb Nick_NZ:
You must save the attachments as file first, then add them to the Task.Attachments -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Hi I have a program (thanks to Sue Mosher) that converts emails into tasks, based on certain words in the subject line. It runs as an Outlook Rule. It works fine except for the attachments. For some reason the attachments that are being sent are not being displayed in the task that is generated. Here is my code: Sub MakeTaskFromMail(MyMail As Outlook.MailItem) Dim strID As String Dim olNS As Outlook.NameSpace Dim olMail As Outlook.MailItem Dim objTask As Outlook.TaskItem strID = MyMail.EntryID Set olNS = Application.GetNamespace("MAPI") Set olMail = olNS.GetItemFromID(strID) Set objTask = Application.CreateItem(olTaskItem) With objTask .Subject = olMail.Subject .DueDate = DateAddW(olMail.SentOn, 5) .ReminderTime = DateAddW(olMail.SentOn, 4) .Importance = olImportanceHigh .Body = olMail.Body .Attachments = olMail.Attachments -WHERE I'M HAVING TROUBLE! End With olMail.Delete objTask.Save Set objTask = Nothing Set olMail = Nothing Set olNS = Nothing End Sub If any one can help here, it would be great! |
#3
|
|||
|
|||
Task Attachments Are Not Being Displayed
Sounds like you eliminated the call to the CopyAttachments() function in the original sample. That function contains the essential functionality that Michael is referring to. See http://www.outlookcode.com/codedetail.aspx?id=959 for a complete sample.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Nick_NZ" wrote in message ... Hi I have a program (thanks to Sue Mosher) that converts emails into tasks, based on certain words in the subject line. It runs as an Outlook Rule. It works fine except for the attachments. For some reason the attachments that are being sent are not being displayed in the task that is generated. Here is my code: Sub MakeTaskFromMail(MyMail As Outlook.MailItem) Dim strID As String Dim olNS As Outlook.NameSpace Dim olMail As Outlook.MailItem Dim objTask As Outlook.TaskItem strID = MyMail.EntryID Set olNS = Application.GetNamespace("MAPI") Set olMail = olNS.GetItemFromID(strID) Set objTask = Application.CreateItem(olTaskItem) With objTask .Subject = olMail.Subject .DueDate = DateAddW(olMail.SentOn, 5) .ReminderTime = DateAddW(olMail.SentOn, 4) .Importance = olImportanceHigh .Body = olMail.Body .Attachments = olMail.Attachments -WHERE I'M HAVING TROUBLE! End With olMail.Delete objTask.Save Set objTask = Nothing Set olMail = Nothing Set olNS = Nothing End Sub If any one can help here, it would be great! |
#4
|
|||
|
|||
Task Attachments Are Not Being Displayed
Thanks for both of your help, i've now fixed the problem
"Sue Mosher [MVP-Outlook]" wrote: Sounds like you eliminated the call to the CopyAttachments() function in the original sample. That function contains the essential functionality that Michael is referring to. See http://www.outlookcode.com/codedetail.aspx?id=959 for a complete sample. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Nick_NZ" wrote in message ... Hi I have a program (thanks to Sue Mosher) that converts emails into tasks, based on certain words in the subject line. It runs as an Outlook Rule. It works fine except for the attachments. For some reason the attachments that are being sent are not being displayed in the task that is generated. Here is my code: Sub MakeTaskFromMail(MyMail As Outlook.MailItem) Dim strID As String Dim olNS As Outlook.NameSpace Dim olMail As Outlook.MailItem Dim objTask As Outlook.TaskItem strID = MyMail.EntryID Set olNS = Application.GetNamespace("MAPI") Set olMail = olNS.GetItemFromID(strID) Set objTask = Application.CreateItem(olTaskItem) With objTask .Subject = olMail.Subject .DueDate = DateAddW(olMail.SentOn, 5) .ReminderTime = DateAddW(olMail.SentOn, 4) .Importance = olImportanceHigh .Body = olMail.Body .Attachments = olMail.Attachments -WHERE I'M HAVING TROUBLE! End With olMail.Delete objTask.Save Set objTask = Nothing Set olMail = Nothing Set olNS = Nothing End Sub If any one can help here, it would be great! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can not open "task request" "task accepted" in Inbox | LaParker | Outlook - General Queries | 2 | August 9th 06 10:09 PM |
All hours are displayed | Joe W | Outlook - Calandaring | 1 | July 27th 06 01:44 AM |
show all recurrences of a task in the task list | dash | Outlook - Calandaring | 2 | April 15th 06 02:45 AM |
How do I drag a task in task list of Outlook. It will not let me. | rpetralia | Outlook - Calandaring | 2 | April 5th 06 10:14 AM |
Link a task to another task | gary | Outlook and VBA | 1 | January 10th 06 04:21 PM |