• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 469
  • Last Modified:

Is it Possible to make outlook revert to Outllok today automatically?

I have looked everywhere but can't find a solution to this so maybe its not possible? If it is possible I can't be the only one who would find this useful.

I have Office Outlook 2003  running with Exchange.

Is there any way to make outlook go back to its default page of "outlook today" on its own?

What I mean is, if I had been viewing an email in the Inbox then after a default period of inactivity next time I look at the screen it is back at "Outlook Today"

Thanks

Steve
0
stevendawson
Asked:
stevendawson
  • 6
  • 6
  • 5
2 Solutions
 
David LeeCommented:
Hi stevendawson,

Hmmm, interesting idea.  I'm not certain it is possible, but if it is it will require code.  Is that an option?  If it is, then I'll look into the possibility of doing this.

Cheers!
0
 
stevendawsonAuthor Commented:
Yes, some code is an option as long as its easy to implement.
0
 
mvidasCommented:
Steven,

Possible? Yes. Easy? No. (well, easy to implement, yeah relatively)

BDF- The only way I can think of doing this is to trap every event of every outlook object and have it reset a 'last used' time variable.  Then have a timer check every 30 seconds or so to see if "now - inactivityperiod > lastusedtime"

Can you think of another way? I started this earlier, and in my outlook2000 there are 27 outlook objects that have events, and can only work on this intermittently for the time being.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
David LeeCommented:
I've been thinking about this and I'm not sure it is possible.  The issue that I can't figure a way around is how to handle idle time.  Matt and I were thinking along the same lines on trapping Outlook events and resetting a timer.  That part is doable.  What I don't see a way to do is how to handle the time between those events.  For example, say you open a new message and are busily typing what you want to say.  Outlook doesn't expose any keyboard or mouse movement events like Visual Basic does, so there'd be no way to know that you're actively doing something.  If the timer ran out while you were typing your message, then the message would go away and you'd be unceremoniously kicked back to Outlook Today.  That's not very desireable and I don't suspect you'd want that happening.  The same thing would occur if you were reading a message and took to long to open a new window or perform one of the actions that would trigger an event and reset the timer.  The only solution I can see to this would be to write some low-level code that would hook into the mouse and keyboard and try to detect the application receiving messages from them.  If the application was Outlook, then you'd raise an event in Outlook that'd reset the timer.  That would require a good deal of effort, and I'm not prepared to do something like that.  Even is we went with something simpler, e.g. just monitoring Outlook events and taking action when one occurs, you'd still run the risk of items closing unexpectedly.  As before, assume you are working on a message and need to open another item to refer to something in it.  Bang, that triggers an event and if the timer has expired your message goes away and you're back at Outlook Today.

I'm open to suggestions.  Perhaps Matt has an approach that I've missed.  Or I may have misunderstood how you envision this working.
0
 
mvidasCommented:
BDF,
Your post made me remember some code I'd seen while looking up something else for my last project.  Let me see if I can find it again, if so it should hopefully do the trick.

0
 
stevendawsonAuthor Commented:
Hi all,

Thanks for your time applying your thoughts to this. Just reading through BDF's last post and I do see that as a problem and clearly would make the idea a non starter but then like a lightning flash I thought of another possible solution:-)

Could we somehow use the reading pane feature?

What I'm thinking is that if the reading pane defaulted to "Outlook Today" it could be a relatively long timer as the whole point of this is not for quick refreshes its for those periods of inactivity when email has probably arrived while you are busy doing other stuff. I like the idea of seeing Outlook Today just prior to looking at those new emails without clicking the link.

Just another idea in the mix.

Thanks

Steve
0
 
mvidasCommented:
Ok, I found the page: http://www.freevbcode.com/ShowCode.Asp?ID=3297
I got it working, though strange to say the hardest part was switching to Outlook Today! I couldn't think of a way to do it other than going to View / Go To / Outlook Today in the menuing system.  Do you know another way to do that, David?

Steve, you'll need to set this up initially, but hopefully only the once then it should be automatic.
First, go to Tools / Macro / Security.  Change your security setting to Medium.
Next, press Alt-F11 from outlook to open the vba/macro editor window.  Go to Insert, then Module, and in the module that appears paste the following block of code:

'***** BEGIN MODULE CODE
Option Explicit
Private Declare Function GetQueueStatus Lib "user32" (ByVal fuFlags As Long) As Long
Private Const TIMEOUTSECONDS As Long = 10
Private Const QS_KEY = &H1
Private Const QS_MOUSEMOVE = &H2
Private Const QS_MOUSEBUTTON = &H4
Private Const QS_MOUSE = (QS_MOUSEMOVE Or QS_MOUSEBUTTON)
Private Const QS_INPUT = (QS_MOUSE Or QS_KEY)
Private bCancel As Boolean
Private Sub WaitForIdle(ByVal TimeOut_InSec As Long)
 Dim t As Double
 t = Timer
 Do While bCancel = False
  If GetQueueStatus(QS_INPUT) Then
   t = Timer
   DoEvents
  End If
  If Timer - t >= TimeOut_InSec Then Exit Do
 Loop
End Sub
Public Sub StartCheckingIdle()
 Do Until bCancel
  WaitForIdle TIMEOUTSECONDS
  If bCancel = False Then GoToOutlookToday
  Do Until GetQueueStatus(QS_INPUT) Or bCancel
   DoEvents
  Loop
 Loop
End Sub
Public Sub StopCheckingIdle()
 bCancel = True
End Sub
Private Sub GoToOutlookToday()
 ActiveExplorer.CommandBars("Menu Bar").Controls("View").Controls("Go To") _
  .Controls("Outlook today").Execute
 DoEvents
End Sub
'***** END MODULE CODE

At the top, change the TIMEOUTSECONDS from 10 seconds, if you'd like the timeout time to be different than that.

Next, press control-r from the editor window to open/focus on the Project window.  Expand the Microsoft Outlook Objects folder, and you should see something in there called ThisOutlookSession.  Double click on that, and in the codepane there paste the following:

'***** START ThisOutlookSession CODE
Option Explicit
Private Sub Application_Startup()
 StartCheckingIdle
End Sub
Private Sub Application_Quit()
 StopCheckingIdle
End Sub
'***** END ThisOutlookSession CODE

Click the Save icon (or press ctrl-s) from the editor to save the project file, and close the editor.
You can start/stop it manually as well by pressing Alt-F8 from outlook and selecting StartCheckingIdle or StopCheckingIdle (they will also be run automatically as outlook is opened/closed).

When you first do this, you'll be prompted to enable/disable macros.  You can click enable the first time, but if you'd like to avoid this prompt you can add a digital certificate to the vbaproject.  For information on this, see the following link, courtesy of David ;)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_dsvba.asp

Please note that if you make any changes to the code, you'll probably have to run StartCheckingIdle again (or close/reopen outlook).

Let us know how it works out!
Matt
0
 
David LeeCommented:
Hi, guys.

Sorry to be so slow answering.  Too much to do and too little time to get it done in.

> the hardest part was switching to Outlook Today!
Try this.  It uses the WebViewOn property to switch to Outlook Today, which is the web view for the root folder.

Sub OpenOutlookToday()
    Dim olkFolder As Outlook.MAPIFolder
    Set olkFolder = Session.GetDefaultFolder(olFolderInbox).Parent
    olkFolder.WebViewOn = True
    Set Application.ActiveExplorer.CurrentFolder = olkFolder
    Set olkFolder = Nothing
End Sub

Matt, excellent solution!  I oft times get fixated on Outlook and forget to look to the OS for the answer.  
0
 
mvidasCommented:
Now I feel very silly :) Would you believe I never thought about changing the .currentfolder? Too funny.  Nice one though!
0
 
mvidasCommented:
BTW In case you're not actively checking EE .. http:/Q_22043802.html - View other user's calendar
0
 
stevendawsonAuthor Commented:
Hi BDF,

Can you please clarify what I need to do with this code?

Sub OpenOutlookToday()
    Dim olkFolder As Outlook.MAPIFolder
    Set olkFolder = Session.GetDefaultFolder(olFolderInbox).Parent
    olkFolder.WebViewOn = True
    Set Application.ActiveExplorer.CurrentFolder = olkFolder
    Set olkFolder = Nothing
End Sub

Thanks

Steve
0
 
David LeeCommented:
Steve,

I posted that in response to Matt's question to me, "Do you know another way to do that, David?"  I was showing him another way to get to the Outlook Today page.  You can use Matt's code exactly as he posted it without this.  
0
 
stevendawsonAuthor Commented:
Hi Again,

This does not work for me and I am unable to delete the macros created. All I end up with is a blank reading pane.

As a result when outlook starts I have to choose to not allow the macros. Any suggestions how to delete those macros?

Thanks

Steve
0
 
David LeeCommented:
One way, although perhaps drastic, is to close Outlook and either rename or delete the file VbaProject.otm.  This file contains all Outlook code.  The file can be found at C:\Documents and Settings\<username>\Application Data\Microsoft\Outlook  The next time Outlook starts it will create a new, empty, file.
0
 
mvidasCommented:
Hi Steve,

What happens that it does not work? It should, everything in it worked for all testing I did (at least in outlook 2000).

As for your macro warning, you may have deleted all the code, but you will need to actually remove the module as well (a blank standard code module, though it contains no actual code, will cause the 'enable macros' dialog to appear).  From the project window (control-r in the VBA editor), right-click on the module, go to Remove Module1 (or whatever it is called) and click No when it asks to export it.  As long as there are no standard or class modules, and no code in the ThisOutlookSession (even a blank line), the prompt should not appear.

Matt
0
 
stevendawsonAuthor Commented:
Hi Matt,

That was it, along with the fact that I needed to remove the code from ThisOutlookSession as well:-)

With regards to why it doesnt work and what happens.

I'm running outlook 2003 in case that makes a difference? with the code installed and the macros enabled the Reading Pane is non existant. well, the space where it should be is there but its just a grey area. Then when the timed script runs the error "Run-time error '5' invalid procedure or argument.

Thanks for your help but I'm going to admit defeat with this and use another solution.

Steve
0
 
stevendawsonAuthor Commented:
Hi Guys,

I split the points as I believe you both deserved them for your efforts.

Thanks

Steve
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 6
  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now