Launch IE browser with website in Outlook Appointment

Posted on 2005-04-01
Medium Priority
Last Modified: 2008-12-23
I am looking for a way for outlook to automatically launch a website from an appointment set in the outlook calendar.
Thank You
Question by:LC7Web
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
  • 5
  • 4
LVL 76

Expert Comment

by:David Lee
ID: 13682673
Hi LC7Web,
> launch a website

I'm not clear on what you mean.  Do you mean a link in the appointment that the user will click on, or do you mean that when the appointment time hits you want the appointment to open the web site, or perhaps that you want the website to open any time the user opens the appointment?


Author Comment

ID: 13682864

Sorry for confusion:

when the appointment time hits you want the appointment to open the web site

Thank You
LVL 76

Expert Comment

by:David Lee
ID: 13683126

No problem.  Ok, I've got the basic concept working.  I need two more pieces of information. First, we have to have a way of differentiating appointments that open a web site from those that don't.  What do you want to use to control this?  Right now I'm using a Category.  But we could key on something else so long as we can use it consistently.  Second, do appointments meeting the criteria all open the same web site, or would some appointments open one site and others open another?  If the latter, then where do you want to store the web site address the appointment will open?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 13683209
A category is fine.

Appointments meeting the criteria open diffrent websites.

For exmaple, at 9:00 am i want to launch the website www.newday.com, so i can read the mornings news.

Then at 12:00 launch a diffrent site.


I dont know where to store them?
LVL 76

Expert Comment

by:David Lee
ID: 13683250
Since they aren't actual meetings, would it be okay to use the Location field?

Author Comment

ID: 13683321
Sure, thats great!
LVL 76

Accepted Solution

David Lee earned 2000 total points
ID: 13683511
Ok, Lou, here it is.  Here's what you need to do to use it.
1.  Open Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already exapnded, expand Microsoft Outlook Objects and click on ThisOutlookSession
4.  Copy the code below and paste it into the right-hand pane of the VB Editor
5.  Edit the code as necessary.  I included comments where things can/need to be changed
6.  Click the diskette icon on the toolbar to save the changes we've made
7.  Close the VB Editor
8.  Click Tools->Macro->Security
9.  Set the Security Level to medium or follow the instructions from this page (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_dsvba.asp) to sign the macro code
10.  Exit Outlook
11.  Start Outlook
12.  If you opted to set the security level down instead of signing the code, then a dialog-box will pop up saying that ThisOutlookSession contains a macro and asking if you want to allow it to run.  Say yes.
13.  Create an appointment
14.  In the Location field type the url of the web site you want to open.  It must be a complete url (i.e. http://www.somesite.com)
15.  In the Categories field enter LaunchWeb, all one word entered exactly as I typed it here
16.  Set the Start Time to the time you want to trigger on
17.  Check Reminder and set the interval to 2 minute
18.  Save the appointment and you're ready to go

How this works
1.  The macro monitors reminder events (this is all we have since there is no event I know of that's fired when the appointment comes due).
2.  When a reminder fires (lots of things can trigger a reminder), the code checks to see if the reminder is for an Appointment.  If it is, then it next checks to see if the time right now is within 2 minutes (you can adjust this if you want) of the appointment's start time.  If it is, then the final check is to see if the appointment category equals the triggering category (we do this to avoid triggering this macro on real appointments).  If it is, then the macro launches the url in the Location field.  If any of the conditions listed are false, then nothing happens at all.

Reminders don't fire exactly on time.  Sometimes they fire very close to when they should, other times it may be several minutes after when they should have fired that they actually fire.  I suspect it has something to do with how busy both Outlook and the computer are when the reminder comes due.  I've set the macro to fire within 2 minutes of the starting time of the appointment.  If you set the reminder time in your appointments to 2 minutes, as I suggested above, then the reminder will likely fire and the web site appear within 2 minutes of the time specified.  You can play with adjusting that if you want.

That's it.  Give it a try and let me know if you have questions or run into problems.

'Macro begins here
Public WithEvents objReminders As Outlook.Reminders, _
    WithEvents objCalendarItems As Outlook.Items

Private Sub Application_Startup()
    Dim objNS As NameSpace
    Set objNS = Application.GetNamespace("MAPI")
    ' instantiate Items collections for folders we want to monitor
    Set objInboxItems = objNS.GetDefaultFolder(olFolderCalendar).Items
    Set objNS = Nothing
    Set objReminders = Application.Reminders
End Sub

Private Sub objReminders_ReminderFire(ByVal ReminderObject As Reminder)
    Dim objShell As Object, _
        objAppointment As Object
    Set objShell = CreateObject("Wscript.Shell")
    If ReminderObject.Item.Class = olAppointment Then
        Set objAppointment = ReminderObject.Item
        'Change the start interval on the next line as desired.  The interval is in minutes.
        If DateDiff("n", Now, objAppointment.Start) <= 2 Then
            'Change the triggering category name on the next line as desired.
            If objAppointment.Categories = "LaunchWeb" Then
                objShell.Run objAppointment.Location
            End If
        End If
    End If
    Set objAppointment = Nothing
    Set objShell = Nothing
End Sub
'Macro ends here

Author Comment

ID: 13683533
Excellent work thanks a lot!
LVL 76

Expert Comment

by:David Lee
ID: 13683652
No problem.  Happy to help out.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
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…
Suggested Courses

764 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