Solved

Open Excel file instead of hyperlink from this code?

Posted on 2008-06-22
1
216 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
1 Comment
 

Accepted Solution

by:
FigmentOfUrImagination earned 0 total points
Comment Utility
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
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…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

772 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

11 Experts available now in Live!

Get 1:1 Help Now