Help!

What is objExplorer_SelectionChange and HTMLBody portion o..

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA RSS
Next:  I want to help you pass your Microsoft certificat..  
Author Message
masani paresh
External


Since: Mar 03, 2009
Posts: 1



PostPosted: Tue Mar 03, 2009 11:39 pm    Post subject: What is objExplorer_SelectionChange and HTMLBody portion of mail
Archived from groups: microsoft>public>outlook>program_vba (more info?)

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
Back to top
Ken Slovak - [MVP - Outlo
External


Since: Oct 17, 2003
Posts: 3355



PostPosted: Wed Mar 04, 2009 9:30 am    Post subject: Re: What is objExplorer_SelectionChange and HTMLBody portion of mail [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum