Copy a Mail Item to the task ffolder

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

I would like to copy an Email to the Task Folder and then
change some properties of that new TaskItem (DueDate e.g.)
I managed to copy the mailItem to the TaskFolder (with
currentitem.copy), but how
do I get hold of that item in order to change the
properties ?
Same applies for mailitems to be copied to the calendar.

Thanks in advance for any hint
Frank
 
Copy is a function that returns an Object. Set your new item to the return
value of the Copy function.
 
Ken
thank you for the response - but I still have a problem
Copying the mailitem generates a mail Item in the Inbox.
Then I move that item to the task folder - How can i get
hold of that item i moved ? code is as follows:

Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)
Set myNewFolder = myNamespace.GetDefaultFolder
(olFolderTasks)
Set myItem = myOlApp.ActiveInspector.CurrentItem
Set myCopiedItem = myItem.Copy


myCopiedItem.Move myNewFolder

thanks again for your help
Frank
 
Move is a function. It returns an Object. Set that Object to an object
variable and work with that.
 
You need to take a different approach: Create a TaskItem with
Application.CreateItem, then set its properties with the information you
want from your mail item.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sue thanks for the hint, I did it !
One more question :
I would like to read through all items say in the Inbox
and check the items. How can I do this? Up to now I
selected a message and fired the code.
But I found nothing like getnextitem
Thanks for your help

Frank
 
You can loop through any folder with a For Each loop:

For Each objItem in objFolder.Items
' do something with objItem
' but don't delete or move it
Next

Use the Namespace.GetDefaultFolder method to return the Inbox folder.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Frank said:
Sue thanks for the hint, I did it !
One more question :
I would like to read through all items say in the Inbox
and check the items. How can I do this? Up to now I
selected a message and fired the code.
But I found nothing like getnextitem
Thanks for your help

Frank
-----Original Message-----
You need to take a different approach: Create a TaskItem with
Application.CreateItem, then set its properties with the information you
want from your mail item.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Ken
thank you for the response - but I still have a problem
Copying the mailitem generates a mail Item in the Inbox.
Then I move that item to the task folder - How can i get
hold of that item i moved ? code is as follows:

Set myFolder = myNamespace.GetDefaultFolder (olFolderInbox)
Set myNewFolder = myNamespace.GetDefaultFolder
(olFolderTasks)
Set myItem = myOlApp.ActiveInspector.CurrentItem
Set myCopiedItem = myItem.Copy


myCopiedItem.Move myNewFolder

thanks again for your help
Frank

-----Original Message-----
Copy is a function that returns an Object. Set your new
item to the return
value of the Copy function.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office
Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


I would like to copy an Email to the Task Folder and
then
change some properties of that new TaskItem (DueDate
e.g.)
I managed to copy the mailItem to the TaskFolder (with
currentitem.copy), but how
do I get hold of that item in order to change the
properties ?
Same applies for mailitems to be copied to the
calendar.

Thanks in advance for any hint
Frank



.


.
 
Back
Top