Solved

How to automatically have a scheduled item update when the task updates in Outlook 2003?

Posted on 2007-04-03
6
184 Views
Last Modified: 2010-04-08
We are looking for a better way to associate Tasks in Outlook 2003 with the Calendar.  We would like it so that when someone updates the time in Tasks, it automatically updates the time of the associated scheduled item in the Calendar.  Thanks
0
Comment
Question by:PCLANTECHS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 18870904
How do we know which item on the calendar is associated with that task?
0
 
LVL 1

Author Comment

by:PCLANTECHS
ID: 18889892
They have the same ticket number prefix
0
 
LVL 76

Expert Comment

by:David Lee
ID: 18916600
Is this information in the subject line of both items?  Also, how long is the ticket numbr prefix and is it alphanumeric?
0
 
LVL 1

Author Comment

by:PCLANTECHS
ID: 18917447
The information is in both the subject lines.  The prefix would be alphanumeric and would include the clients name or business name.  An Example would be "M05_Client Name, "
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 18930528
Got it.  Ok, we can accomplish this with a script like the one below.  This code monitors the Tasks folder watching for items being changed.  When it sees a change it searches the Calendar for a matching item.  If it finds a match, then it updates the appointment.  If it finds more than one match, then it displays an error message.  I tested this code using Outlook 2003 and it worked perfectly.  Follow these instructions to use it.

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code marked as going in ThisOutlookSession and paste it into the right-hand pane of the VB Editor window
5.  Edit the code as needed.  I placed a comment line immediately before each line that needs editing
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Click Tools->Macro->Security
9.  Set the Security Level to Medium
10.  Close Outlook
11.  Start Outlook
12.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.  Yoou can avoid having to do this each time by signing the code.  Instructions for doing that are here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_dsvba.asp


Public WithEvents olkItems As Outlook.Items

Private Sub Application_Quit()
    Set olkItems = Nothing
End Sub

Private Sub Application_Startup()
    Set olkItems = Session.GetDefaultFolder(olFolderTasks).Items
End Sub

Private Sub olkItems_ItemAdd(ByVal Item As Object)
    'Code to process the task item being added
    'We could add code here that would create an appointment each time a task is added
End Sub

Private Sub olkItems_ItemChange(ByVal Item As Object)
    Dim olkCalendar As Outlook.Items, _
        olkMatches As Outlook.Items, _
        olkAppointment As Outlook.AppointmentItem, _
        strKey As String
    Set olkCalendar = Session.GetDefaultFolder(olFolderCalendar).Items
    strKey = Item.Subject
    'This matches on the entire subject line.  If we need to use just a portion of the
    'subject line, then I'll need to know more about the subject line so I can figure a way
    'to extract just the portion we need.
    Set olkMatches = olkCalendar.Restrict("[Subject] = '" & strKey & "'")
    If olkMatches.Count = 1 Then
        Set olkAppointment = olkMatches.Item(1)
        With olkAppointment
            'I'm not clear on how you want the time updated, so this is just an example
            .Start = Item.DueDate
            .Save
        End With
    Else
        MsgBox "The calendar contains more than one appointment that matches the task." & vbCrLf & "Processing aborted.", vbCritical + vbOKOnly, "Update Associated Appointment"
    End If
    Set olkAppointment = Nothing
    Set olkMatches = Nothing
    Set olkCalendar = Nothing
End Sub

Private Sub olkItems_ItemRemove()
    'Code to process the task item being deleted
    'We could add code here that would delete the associated appointment
End Sub
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question