Hey /w VB Code...

S

-=Sojourn=-

I had this code to switch my view every hour to the Outlook main screen;
but it no longer works /w Outlook 2003 - can anyone help?

Thanks in advance!

Dim iHour

Private Sub SwitchView()
If Hour(Now) <> iHour Then
Dim ctl As Office.CommandBarControl
Dim cbpop As Office.CommandBarPopup
Dim cb As Office.CommandBar

Set cb = Application.ActiveExplorer.CommandBars("Menu Bar")
Set ctl = cb.FindControl(ID:=5599, Recursive:=True)
ctl.Execute
iHour = Hour(Now)
Set ctl = Nothing
Set cb = Nothing
End If
End Sub
 
R

Roady [MVP]

The code looks correct at first and also the command ID for Outlook Today
hasn't been changed.

Do you have the Macro enabled? As a secure default Outlook doesn't load
unsigned macro's. You can change this in Tools-> Macro-> Security

--
Robert Sparnaaij [MVP-Outlook]
www.howto-outlook.com

Tips of the month:
-Creating Signatures
-Create an Office XP CD slipstreamed with Service Pack 3
 
S

-=Sojourn=-

The code looks correct at first and also the command ID for Outlook Today
hasn't been changed.

Do you have the Macro enabled? As a secure default Outlook doesn't load
unsigned macro's. You can change this in Tools-> Macro-> Security
It loads the macro fine, if I step through it it runs the code, but
doesn change the view to Outlook Today.
 
R

Roady [MVP]

See if the developers can help you with it in the outlook.program_vba
newsgroup

Good luck!

--
Robert Sparnaaij [MVP-Outlook]
www.howto-outlook.com

Tips of the month:
-Creating Signatures
-Create an Office XP CD slipstreamed with Service Pack 3

-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top