Converting mail items to task (outlook2002) 
Author Message
 Converting mail items to task (outlook2002)

I am new to outlook and vba. I'm trying to write some code to convert
new mail items in an inbox to tasks in a task folder.
I have written some code to create a task which I have tested as a
stand alone module. I am not sure about calling modules and passing
parameters in VBA though.
I assume I will have to write some code which fires on the
Application.newmail event, reads the subject and body of the mail and
calls the create_task module with these parameters.

Sub create_task(Subject As String, Body As String)
    MsgBox ("create_task")
    Set myOlApp = CreateObject("Outlook.Application")
    Set myNameSpace = myOlApp.GetNamespace("MAPI")
    Set myFolder = myNameSpace.GetDefaultFolder(olFolderTasks)
    Set myItem = myOlApp.CreateItem(olTaskItem)
    myItem.Subject = Subject
    myItem.Body = Body
End Sub

Can anybody offer any help?


Tue, 27 Apr 2004 23:17:33 GMT  
 [ 1 post ] 

 Relevant Pages 

1. create an e-mail mailing from a folder containing tasks items

2. Changing from mail-item to task-item

3. Converting Attachment to a mail item to view internet headers using CDO

4. How to Create Task Item in Someone Else's Task Folder

5. Adding Menu item to the Mail item menu from an outlook Addin

6. Adding Menu item to the Mail item menu from an outlook Addin

7. attached Contact Item on server-side becomes attached Mail Item on client-side

8. attached contact item is received as mail item

9. How can I iterate through task items in VBA

10. How to copy a task item programmatically

11. Add item to delegated task folder?

12. Creating New Task Item - VBScript


Powered by phpBB® Forum Software