Sending TaskItem via Attachment

  • Thread starter Thread starter Ryan Hubbard
  • Start date Start date
R

Ryan Hubbard

I can send an email with an attached taskItem object. How would I
then take that taskitem object attachment and create a task from it
and place it a task folder? Thanks in advance.
 
You would have to save the attachment to the file system and from there open
the saved item to get it to open as a new task. Once you do that you can add
it or move it to a specific folder.
 
Alright I figured it out by saving the attachment (savefileas method)
and then using the Application.CopyFile method to copy that file to
the task folder. Is this indeed the best way to do it or is there a
better way?

Also when doing so, the new task has an outlook icon instead of the
default task icon. Can i programmatically change the icon? Or is
there a way to create it with the default task icon?


Thanks
 
That's as good a way as any.

See if after you add the item to the folder if you get it and set the
MessageClass as "IPM.Task" if that changes the icon.
 
I have created the new task 2 ways. The first with the
Application.CopyFile method and the second saving the file with an oft
extension and then using the CreateItemFromTemplate method.

The first way creates a task with an outlook icon and does not display
all the values of the item when viewing from the list in outlook (ex:
Displays due date but not status is empty yet there is a value set for
it). If opened in the inspector it acts normal. The messageClass is
already set to IPM.Task. Yet in the list view it does not display all
the values and you cannot change any of them via the view list but you
can change them if you open it and use the inpsector.

The second method works perfect.

My question is why do these act so different. I've used OutlookSpy to
try to find some value that differs to be able to find a reason but I
have not found one. Infact most of the values are identical.

Thanks for your help.
 
I'm not sure why the difference but if the second method works better then
use it. Outlook coding can sometimes be a mysterious and mystifying process
:)
 
Back
Top