Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Outlook 2007 Programming ISBN: 978-0-470-04994-5
This is the forum to discuss the Wrox book Professional Outlook 2007 Programming by Ken Slovak; ISBN: 9780470049945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Outlook 2007 Programming ISBN: 978-0-470-04994-5 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 21st, 2011, 02:10 PM
Registered User
Join Date: Jan 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ontime Method in Outlook


I have been trying to use the ontime method in outlook and keep getting error 438, Object does not support this property or method. I coppied the code into excel and it works fine. Does anyone know why it would work in excel but not in Outlook?

 'Code placed in UserForm:
Sub TryThis()
    Application.OnTime Now + TimeValue("00:00:15"), "SayHello"
End Sub

'Code placed in Module:
Public Sub SayHello()
    MsgBox "Hello!"
End Sub
Reply With Quote
  #2 (permalink)  
Old September 13th, 2011, 12:13 PM
JP JP is offline
Authorized User
Points: 199, Level: 3
Points: 199, Level: 3 Points: 199, Level: 3 Points: 199, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Apr 2008
Location: NYC, NY, USA.
Posts: 57
Thanks: 1
Thanked 3 Times in 3 Posts

I know this post is old, but I thought I'd answer anyway. Outlook does not have an OnTime method, but Excel does. That is why it works in Excel but not Outlook.

To simulate the OnTime Method, create a task with a reminder for the time you want the macro to run. Use a unique Subject string for the task. Hook the BeforeReminderShow Event and check for the unique string in the Subject that you specified when you created the task. If it's a match, run the macro you wanted to run at that time. Also, set Cancel = True so the reminder doesn't actually fire (it already did it's job so it doesn't need to actually fire).
JP SoftTech
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook VBA Beginner Q, Outlook get email address from Excel file summerlight BOOK: Professional Outlook 2007 Programming ISBN: 978-0-470-04994-5 0 December 28th, 2010 06:22 AM
Outlook jdhock8865 Beginning VB 6 3 July 9th, 2008 12:01 PM
Outlook magicroy Excel VBA 0 July 25th, 2007 09:56 AM
Outlook Help ksrmramu Classic ASP Components 0 August 22nd, 2005 07:28 AM
Outlook dinkelfwat Pro VB 6 0 August 20th, 2003 08:19 AM

All times are GMT -4. The time now is 01:16 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.