Solved

Outlook 2007

Posted on 2011-03-03
9
373 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Outlook Free & Paid Tools
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

943 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

5 Experts available now in Live!

Get 1:1 Help Now