Google Groups Home
Help | Sign in
Message from discussion Need Help creating tasks programmatically
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Rick Williams  
View profile
 More options Mar 7 2000, 3:00 am
Newsgroups: microsoft.public.outlook, microsoft.public.outlook.program_addIns, microsoft.public.outlook.program_vba, microsoft.public.outlook.thirdpartyutil
From: "Rick Williams" <rickwilli...@scramsoftware.vallnet.com>
Date: 2000/03/07
Subject: Need Help creating tasks programmatically
I am trying to create Outlook tasks in a VB app, assign them to various team
members, and have the status of the tasks reflected in my task list.

My code is below. It reads the information from a database and creates the
tasks just fine. But it sends two e-mails for every task, a 'Request' and an
'Update', and if I status a task from a receiver, the results are not
reflected in my Task view. I know it has to do with the various types of
recipient, but I have't been able to pin it down. Can you help?

    Set appOut = CreateObject("Outlook.Application")
    Adodc1.RecordSource = "Select * from Steps Where ProcessID='" &
txtFields(0).Text & "'"
    Adodc1.Refresh
    Dim Counter As Integer
    Counter = 0
    Do While Not Adodc1.Recordset.EOF
        Set tsksOut = appOut.CreateItem(olTaskItem)
        tsksOut.Recipients.Add (Adodc1.Recordset.Fields("AssignedTo_EMail"))
'recipient's email address
        tsksOut.Recipients(1).Type = 2
        tsksOut.Recipients.Add (txtFields(3).Text)
        tsksOut.Recipients(2).Type = 3
        tsksOut.Subject = Adodc1.Recordset.Fields("Step_Name") & " -
Assignment for process " & txtFields(1).Text & " from " & txtFields(3).Text
        tsksOut.Body = "Step Name: " & Adodc1.Recordset.Fields("Step_Name")
& Chr(10) & "Description: " & Adodc1.Recordset.Fields("Step_Description") &
Chr(10) & "Instructions: " & Adodc1.Recordset.Fields("Instructions")
        tsksOut.DueDate = CDate(txtFields(10).Text)
        tsksOut.Owner = txtFields(3).Text ' this text box holds the sender's
e-mail
        tsksOut.SchedulePlusPriority = "High"
        tsksOut.StatusOnCompletionRecipients = txtFields(11).Text 'this text
box holds the sender's e-mail address
        tsksOut.StatusUpdateRecipients = txtFields(11).Text 'this text box
holds the sender's e-mail address
        tsksOut.TeamTask = True
        tsksOut.Recipients.ResolveAll
        tsksOut.Assign
        tsksOut.Send
        tsksOut.Save
        Adodc1.Recordset.MoveNext
        Counter = Counter + 1
    Loop

I would appreciate any help you could offer. Thank you very much.

Rick Williams
http://www.scramsoftware.vallnet.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google