?
Solved

Open Excel file instead of hyperlink from this code?

Posted on 2008-06-22
1
Medium Priority
?
222 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

Industry Leaders: 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

In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
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…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Suggested Courses

801 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