Controlling Outlook application size and position

G

Guest

I'd like to write some VBA code to control the size and desktop position of
the Outlook application window. Any help will be greatly appreciated. TIA

Ken
 
K

Ken Slovak - [MVP - Outlook]

Outlook.Application.ActiveExplorer is the main Outlook window and you can
control the size of the window using the Height, Left, Top and Width
properties of that object.
 
G

Guest

Thanks Ken. I wrote a procedure that sets the size and position of the
Outlook application. I called the procedure AutoExec() on the hope that
Outlook might automatically run the procedure whenever it is launched. That
doesn't happen. How can I get the procedure to run automatically as desired.
BTW, if you can recommend a good book that describes this type of
programming for Outlook I would again be very appreciative.

Ken
 
K

Ken Slovak - [MVP - Outlook]

AutoExec means nothing to Outlook.

In the Outlook VBA project you should see the ThisOutlookSession class
module under the Microsoft Office Outlook Objects tree in the Project
Explorer. Expand that and put your macro in the Application_Startup event
handler. In the Object dropdown at the top left of the module code select
Application. In the right-hand dropdown select Startup, put your code there.

You would also need to set the macro security based on whether or not you
are signing your code to get the macro to run when Outlook starts up.
 

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