Solved

Outlook 2007

Posted on 2011-03-03
9
374 Views
Last Modified: 2012-06-21
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
Comment
Question by:jegajothy
  • 5
  • 4
9 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35034189
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
 

Author Comment

by:jegajothy
ID: 35035865
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
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35037238
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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:jegajothy
ID: 35041282
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
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 35041952
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
 

Author Closing Comment

by:jegajothy
ID: 35043315
Chris is a Super Guru - Bravo and well done.
0
 

Author Comment

by:jegajothy
ID: 35043322
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
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35043441
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
 

Author Comment

by:jegajothy
ID: 35046276
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

786 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