| | |
Outlook.Selection: determine what type of item is selected.
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
This is what I meant
I want to know the item selected to filter if it is the item that I want. But it seems the line in red it gives me an error.
Outlook.Application app = new Outlook.Application();
Outlook.Selection oSel;
Outlook.Explorer oEx = app.ActiveExplorer;
oSel = oEx.Selection;
Object oItem;
oItem = oSel.Item;
String msgClass = oItem.MessageClass;
I want to know the item selected to filter if it is the item that I want. But it seems the line in red it gives me an error.
An Avalanche In D Minor
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
But VB is lazy and allows you to do hiddeous things like adding characters and integers and setting strings to numbers if you let it. That doesnt make it right.
if you declare object as o you could test if o is Outlook.MailItem that seems to work.
if you declare object as o you could test if o is Outlook.MailItem that seems to work.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
Good god, no offense but that sounds as lazy as it gets
all you had to do was paste in the info given..
C# Syntax (Toggle Plain Text)
Outlook.Application app = new Outlook.Application(); Outlook.Selection oSel; Outlook.Explorer oEx = app.ActiveExplorer; oSel = oEx.Selection; Object oItem; oItem = oSel.Item; if (oItem is Outlook.MailItem) { Outlook.MailItem oMail = (Outlook.MailItem)Oitem; label1.Text = oMail.Subject; }
all you had to do was paste in the info given..
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
![]() |
Other Threads in the C# Forum
- Previous Thread: Drag and drop items from forms to the desktop or to any entity outside the form.
- Next Thread: Letter combinations
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access algorithm array barchart bitmap box buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






