Solved

Open Excel file instead of hyperlink from this code?

Posted on 2008-06-22
1
220 Views
Last Modified: 2010-05-18
Hi there,

I found this other post:

http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_21372956.html 

which allows an Outlook Appointment to open a hyperlink when that Appointment is activated.

What I'd like to do is open an Excel spreadsheet instead of the hyperlink. Is this possible to do?
I've attatched the code that I'm using, which I have running.

Many thanks,
Scott.
'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

Open in new window

0
Comment
[X]
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
1 Comment
 

Accepted Solution

by:
FigmentOfUrImagination earned 0 total points
ID: 21841725
I've managed to sort it.

Using the same method wasn't working, but I removed the spaces from the path to my excel file and it's now working.

Thanks
0

Featured Post

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!

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

733 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