View Single Post
  #6  
Old July 6th 09, 07:56 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Switch Mail format

My error there in the instructions, the WithEvents declarations and event
handlers should be in a class (which could be ThisOutlookSession), and yes
the Activate() event should be as you mention for an event signature.

If you want this to run on demand the macro can be much simpler and would be
in either a code module or ThisOutlookSession:

Sub ChangeFormat()
Application.ActiveInspector.CurrentItem.BodyFormat = olFormatPlain
End Sub

However, you can just use the format changing menu commands in that case and
not bother with a macro.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Mats Samson" wrote in message
news
Ken,
I find the code confusing!
The WithEvents doesn't fit in to a Module, they seem to fit into a
ThisOutlookSession!?! If I run it from there I get compile error in the
"Sub
colInsp_NewInspector(Inspector As Inspector), not matching description or
having the same name.
Furthermore the Sub oInsp.Activate() must be oInsp_Activate, right?

The best solution would be if I can attach the code to a toolbar button so
when I want to send a fax, I press the button and I get a new plain text
message.
Regards
Mats


Ads