You can't write a rule to make Outlook behave as you want, but you could
have Outlook go to the Unread Mail Search Folder when it starts up. Since
you can restrict the folders that search folders search in you can get
approximately the result you want this way.
-Peter
>I want upon starting OL07 to have it normally go to Inbox, but instead
> go to folder XYZ if there is anything unread in XYZ. (BTW, I don't
[quoted text clipped - 10 lines]
> ( However, just as a matter of style, I'd prefer to avoid code if
> it's built it - avid coder avoids coding :) )
zofficedepot@hotmail.com - 29 May 2008 00:22 GMT
Thank you Peter for the reply and helpful suggestions. But I only want
to go to Unread of one specific folder; and as far as using a search
folder goes I don't see where you can specify "Unread," which is the
only circumstance I want to go there. Anyway I hadn't even conceived
of using a search folder as startup default. Thank you for that
thought-inspiring idea.
Well if it's not built in this should be easy for regular Outlook
coders. Is there another Outlook group where programmers go?
Otherwise, this (below) needs help. Note the crashing line containing
the word invalid. (Better yet, is there a direct property instead of
For Each, in the spirit of "Unread.count" ?)
Private Sub test_StartupSearchFolderFooForUnRead() 'and go there if
anything unread
Dim olapp As Outlook.Application, objFolder As Outlook.Folder,
myItem As mailItem
Set olapp = Outlook.Application 'Should I even bother w/ this var.?
Set objFolder = olapp.Session.Folders("Mailbox - John
Doe").Folders("Excel")
For Each myItem In objFolder 'This line invalid. Help?
If myItem.UnRead Then
objFolder.Display
Exit For
End If
Next
Set objFolder = Nothing: Set olapp = Nothing
End Sub
I guess "run a script" means something else.
Might this go in ThisOutlookSession Application_Startup?
I understand that this does not switch from the current Folder (which
I have defaulted to Inbox).
Thanks for reading this far!
zofficedepot@hotmail.com - 29 May 2008 19:55 GMT
Am I using the wrong forum? Or is this subject name such that few even
read the thread? I thought this would be trivial to most nonbeginners.
Brian Tillman - 30 May 2008 12:42 GMT
> Well if it's not built in this should be easy for regular Outlook
> coders. Is there another Outlook group where programmers go?
Yes. Code discussion is in microsoft.public.outlook.program_vba

Signature
Brian Tillman [MVP-Outlook]