A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Task Attachments Are Not Being Displayed



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 17th 06, 03:02 AM posted to microsoft.public.outlook.program_vba
Nick_NZ
external usenet poster
 
Posts: 9
Default 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  
Old August 17th 06, 06:51 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default 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  
Old August 17th 06, 04:38 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default 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  
Old August 18th 06, 03:38 AM posted to microsoft.public.outlook.program_vba
Nick_NZ
external usenet poster
 
Posts: 9
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 04:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.