Solved

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

Posted on 2006-10-25
17
374 Views
Last Modified: 2008-03-10
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
Comment
Question by:stevendawson
  • 6
  • 6
  • 5
17 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 17805679
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
 
LVL 2

Author Comment

by:stevendawson
ID: 17805737
Yes, some code is an option as long as its easy to implement.
0
 
LVL 35

Expert Comment

by:mvidas
ID: 17805903
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
 
LVL 76

Expert Comment

by:David Lee
ID: 17818085
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
 
LVL 35

Expert Comment

by:mvidas
ID: 17818477
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
 
LVL 2

Author Comment

by:stevendawson
ID: 17818731
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
 
LVL 35

Assisted Solution

by:mvidas
mvidas earned 250 total points
ID: 17818772
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
 
LVL 76

Accepted Solution

by:
David Lee earned 250 total points
ID: 17840996
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 35

Expert Comment

by:mvidas
ID: 17841935
Now I feel very silly :) Would you believe I never thought about changing the .currentfolder? Too funny.  Nice one though!
0
 
LVL 35

Expert Comment

by:mvidas
ID: 17842175
BTW In case you're not actively checking EE .. http:/Q_22043802.html - View other user's calendar
0
 
LVL 2

Author Comment

by:stevendawson
ID: 17847832
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
 
LVL 76

Expert Comment

by:David Lee
ID: 17848541
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
 
LVL 2

Author Comment

by:stevendawson
ID: 17901844
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
 
LVL 76

Expert Comment

by:David Lee
ID: 17902934
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
 
LVL 35

Expert Comment

by:mvidas
ID: 17903574
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
 
LVL 2

Author Comment

by:stevendawson
ID: 17904789
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
 
LVL 2

Author Comment

by:stevendawson
ID: 18001552
Hi Guys,

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

Thanks

Steve
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Junk folder 23 112
Instructions for user changing Office 365 OWA password 3 43
Outlook 2010 Calendar 5 42
EXCH2013 and DAG settings 9 33
Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
Check out this infographic on what you need to make a good email signature that will work perfectly 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 …
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: …

743 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

13 Experts available now in Live!

Get 1:1 Help Now