Question on ThisOutlookSession or OutAddIn.cls methods.

P

paresh

#1
Hi,

I have noticed that below code works fine if I put that code in

ThisOutlookSession or in OutAddIn.cls(Add-in). Is it possible to put this

code in any module(.bas) or designers(Connect.Dsr) code and make it work?

Private WithEvents objExpl As Outlook.Explorer

Private Sub objExpl_SelectionChange()

Set objExpl = objOutlook.ActiveExplorer 'Explorer Object

If objExpl.Selection.Count > 0 Then

For Each objMailItem In objExpl.Selection

If objMailItem.Class = olMail Then

msgbox "email item";

End If

Next

End If

End Sub

Thanks,

Paresh
 
P

paresh

#2
Sorry, I posted two similar question accidentally.

"paresh" wrote:


> Hi,

> I have noticed that below code works fine if I put that code in
> ThisOutlookSession or in OutAddIn.cls(Add-in). Is it possible to put this
> code in any module(.bas) or designers(Connect.Dsr) code and make it work?

> Private WithEvents objExpl As Outlook.Explorer

> Private Sub objExpl_SelectionChange()
> Set objExpl = objOutlook.ActiveExplorer 'Explorer Object
> If objExpl.Selection.Count > 0 Then
> For Each objMailItem In objExpl.Selection
> If objMailItem.Class = olMail Then
> msgbox "email item";
> End If
> Next
> End If
> End Sub

> Thanks,
> Paresh
 

Similar threads

Top