Solved

Open Excel file instead of hyperlink from this code?

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

Zoho SalesIQ

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
User is no longer able to see a delegated calendar on his iPhone 7 77
ost file to pst 10 102
Outlook 2010 does not display images 2 49
EXCH2013 - Archive mailboxes 2 42
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Find out what you should include to make the best professional email signature for your organization.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
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…

914 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

16 Experts available now in Live!

Get 1:1 Help Now