Pretty obvious, no?
When the selection changes in that Explorer if 1 or more items are selected
each mail item in the selection is instantiated and if it's an email item
and an HTML item then some ClickDial() method is called with the HTMLBody
and another argument.
Of course that code will fire lots of exceptions since it assigns a MailItem
object as the Selection item being iterated, and if it's not an email item
an exception will fire. Better written code would check to see if the Class
property was olMail before assigning the object to a MailItem object.
--
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
"masani paresh" <masanip.DeleteThis@deshaw.com> wrote in message
news:0284147C-24AA-4A5F-B430-536889C8F684@microsoft.com...
> Could any one please tell me what below code do?
>
> Private Sub objExplorer_SelectionChange()
> Dim objMail As Outlook.MailItem
> If objExplorer.Selection.Count > 0 Then
> For Each objMail In objExplorer.Selection
> If objMail.Class = olMail Then
> If objMail.BodyFormat = olFormatHTML Then
> objMail.HTMLBody = ClickDial(objMail.HTMLBody,
> Webdial_Url)
> End If
> End If
> Next
> End If
> End Sub
>
>
> --
> Thanks,
> Paresh