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
wrote:
> You will obviously need a reference to Outlook in your VBA project. Then in
> a code module something like this:
> ' Module level code
> Dim WithEvents colInsp As Outlook.Inspectors
> Dim WithEvents oInsp As Outlook.Inspector
> Dim oApp As Outlook.Application
> Dim oNS As Outlook.NameSpace
> Dim blnFirstActivate As Boolean
> Sub SetThingsUp()
> Set oApp = CreateObject("Outlook.Application")
> Set oNS = oApp.GetNameSpace("MAPI")
> oNS.Logon "", "", False, False
> Set colInsp = oApp.Inspectors
> End Sub
> Sub colInsp_NewInspector(Inspector As Inspector)
> If (Inspector.CurrentItem.Class = olMail) Then
> blnFirstActivate = False
> Set oInsp = Inspector
> End If
> End Sub
> Sub oInsp.Activate()
> If (Not blnFirstActivate) Then
> blnFirstActivate = True
> If (oInsp.CurrentItem.BodyFormat = olFormatHTML) Then
> oInsp.CurrentItem.BodyFormat = olFormatPlain
> End If
> End If
> End Sub
> >
>
> "Mats Samson" <MatsSamson> wrote in message
> news:75E68B38-E8F8-46A6-A824-4B7424116942@microsoft.com...
> > Thanks Ken,
> > but I'm fairly unfamiliar with Outlook programming, usually I work with
> > Excel and I know there are special arguments etc that have to be set
> > before
> > Outlook cooperates with you, so..... I would appreciate if you can give me
> > a
> > code example?
> > Cheers
> > Mats
>