Solved

Outlook 2007

Posted on 2011-03-03
9
372 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
 

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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now