• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

Outlook 2007

Can I create a link for an incoming email to be added to the outlook calendar.  The date should be prompt from user.  If Yes, what are the steps. thank u.
My OS is windows 7.
0
jegajothy
Asked:
jegajothy
  • 5
  • 4
1 Solution
 
Chris BottomleyCommented:
Short answer yes ... it would require a macro if that is ok then do you want all incoming mails to be added or is there a filter as to which mails require a calendar entry?

Chris
0
 
jegajothyAuthor Commented:
in response to Chris.  I would prefer a macro that will be run from the message that has been selected.  This is because most of the time the senders are different and thus the format is not standard.  Thus, it would be ideal if the selected email can be added to the calendar.  thank u.
0
 
Chris BottomleyCommented:
A basic macro to what you require is as below.

To run as a rule you would call addCalItemfromRule whereas to run on the current selection use addCalItem NOTE it prioritises to use the first open item and if none found to use the selected item in the outlook folder window.

I have defaulted it be an all day appt set at 09:00 but hopefully you can see what to change but if not please ask

Chris
Sub addCalItemfromRule(mai As MailItem)
    addCalItem (mai)
End Sub

Sub addCalItem(Optional mai As MailItem)
Dim strDate As String
Dim calitem As Object

    If mai Is Nothing Then
        If TypeName(Application.ActiveWindow) = "Inspector" Then
            Set mai = Application.ActiveInspector.CurrentItem
        ElseIf TypeName(Application.ActiveWindow) = "Explorer" Then
            Set mai = Application.ActiveExplorer.Selection(1)
        Else
            Exit Sub
        End If
    End If

    strDate = InputBox("Please Enter the date for the Calendar entry ... or blank to skip", "Shortcut to Mail Item in Calendar")
    If strDate <> "" Then
        If IsDate(strDate) Then
            With Application.CreateItem(olAppointmentItem)
                .AllDayEvent = True
                .Start = DateValue(strDate) + TimeSerial(9, 0, 0)
                .ReminderMinutesBeforeStart = 15
                .ReminderSet = True
                .Subject = mai.Subject
                .Save
            End With
        End If
    End If
End Sub

Open in new window

0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
jegajothyAuthor Commented:
In response to Chris, u are a confirmed Guru, thank u.
How do I create a new macro and insertt your code.  When I click on macros, there is one macro which had pasted before, but the Create button is greyed out.
If I place the code in VB editor in a Module, but when I click on Macro, the procedure does not show.
Thank u again.
0
 
Chris BottomleyCommented:
Modified to support calling from the run menu\\Chris.  Kept the same structure so simply add the new sub to the module\

Chris
Sub RunAddCalItem()
    addCalItem
End Sub

Open in new window

0
 
jegajothyAuthor Commented:
Chris is a Super Guru - Bravo and well done.
0
 
jegajothyAuthor Commented:
To Chris,
I did a little of VB many moons ago, but can u please point me in the direction, where u learned to code for Outlook.  What version of Vb, etc. thank u
0
 
Chris BottomleyCommented:
can u please point me in the direction, where u learned to code for Outlook

1. Sue Moshers books: http://www.amazon.co.uk/Microsoft-Outlook-Programming-Administrators-Developers/dp/1555582869/ref=sr_1_6?s=books&ie=UTF8&qid=1299331429&sr=1-6 for 2003 as an example, also for 2007 she produced olk 2007 programming.  Haven't seen anything since from her, though I tend to think I have enough skill to muddle through in most cases.

2. Watching BDF's work here, http://www.experts-exchange.com/M_1311730.html

3. Simply having a go ... mistakes and all, I learned a long time ago there is nothing with getting it wrong and I can be sure here that David, (BDF) will help out when I am wrong ... note when not if!

4. Glad to help

Chris
0
 
jegajothyAuthor Commented:
In response to Chris, thank u, but the price looks steep for me at the time being.  Hopefully it will come down in a month or so.  I did vb way back in 2001 so looks like the vb itch is still within me. Thank u for the information.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now