Anyone have a sample macro for Outlook 2007 (setting the zoom)?

  • Thread starter Thread starter Dick
  • Start date Start date
D

Dick

I'd like to find a sample macro for OUtlook 2007. Ideally would be one that
sets the szoom level on a message, but I'll take any sample macro and wtry to
work with it.

I would just record a macro, but recording seems to have been disabled in
some earlier verion of Outlook. Thanks!
 
Unlike Word or Excel, Outlook has never had a macro recorder. You always
have had to write your own macros from scratch in Outlook since VBA was
added to it.

Since Outlook 2007 uses WordMail setting zoom percentage would have to be
handled using Word object model code, however in this case the object model
exposed for mail items doesn't allow you to do that. The code:

Application.ActiveInspector.WordEditor.ActiveWindow.View.Zoom.Percentage
= 125

will just throw an error.

The best you could do with a macro would be to call to open the zoom dialog
in an email item. The actual zoom setting would have to be set manually.
That code would look like this, assuming the item was opened and had focus:

Application.ActiveInspector.CommandBars.ExecuteMso("ZoomDialog")

That will execute the ribbon control that opens the zoom dialog.
 
Back
Top