Can I convert this simple outlook 2000 macro to run via a form ?

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

I have the following outlook vba macro code

Set olkApp = CreateObject("Outlook.Application")
Set myExplorer = olkApp.ActiveExplorer
myExplorer.ShowPane olFolderList, True
myExplorer.ShowPane olOutlookBar, False

I do not have any office development tools and am looking for a simple
way to send this out to my org.

The form would be simple and I would use the open event. I hoping that
someone here can tweak the above and help me /advise.

Thank you
 
If you put the code in a form it would have to be published for the
code in Item_Open to run.

Function Item_Open()
Dim myExplorer
Const olFolderList = 2
Const olOutlookBar = 1

Set myExplorer = Application.ActiveExplorer
myExplorer.ShowPane olFolderList, True
myExplorer.ShowPane olOutlookBar, False

Set myExplorer = Nothing
End Function

BTW, in an Outlook VBA macro you don't need to create an
Outlook.Application object, you can just use Application.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
Thanks Ken,

It looks so simple like that !

My reason for doing this is so people can see that they have move than
an INBOX and clear the mailbox before we have a server crash because
of disk space problems.

Too late already happened, once its back up I will test it


Ken Slovak - said:
If you put the code in a form it would have to be published for the
code in Item_Open to run.

Function Item_Open()
Dim myExplorer
Const olFolderList = 2
Const olOutlookBar = 1

Set myExplorer = Application.ActiveExplorer
myExplorer.ShowPane olFolderList, True
myExplorer.ShowPane olOutlookBar, False

Set myExplorer = Nothing
End Function

BTW, in an Outlook VBA macro you don't need to create an
Outlook.Application object, you can just use Application.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


Andrew said:
I have the following outlook vba macro code

Set olkApp = CreateObject("Outlook.Application")
Set myExplorer = olkApp.ActiveExplorer
myExplorer.ShowPane olFolderList, True
myExplorer.ShowPane olOutlookBar, False

I do not have any office development tools and am looking for a simple
way to send this out to my org.

The form would be simple and I would use the open event. I hoping that
someone here can tweak the above and help me /advise.

Thank you
 
Back
Top