Question on ThisOutlookSession or OutAddIn.cls methods.

P

paresh

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top