![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
How can I retrieve information such as Sender, Recipient, Subject, Sent Date,
Mail Size from the Inbox of Microsoft Office Outlook 2003? Regards D |
Ads |
#2
|
|||
|
|||
![]()
Use ActiveExplorer.CurrentFolder.Items to get the collection of items in the
folder (if the Inbox is currently being displayed). Otherwise use NameSpace.GetDefaultFolder(olFolderInbox).Items to get that collection. Iterate the collection and retrieve whatever properties you want from each item. Make sure to test for item.Class = olMail if you are only interested in mail items. -- 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 "DMc2004" wrote in message ... How can I retrieve information such as Sender, Recipient, Subject, Sent Date, Mail Size from the Inbox of Microsoft Office Outlook 2003? Regards D |
#3
|
|||
|
|||
![]()
Hi Ken,
I'm having problem following the suggestion you offer. I'm converting an Outlook 2003 add-in that I prototyped in vb using VS2005. The problem is identifying the currently selected mail item. in vb I was using : Dim selItem As Outlook.MailItem = _Explorer.Selection(1) I converted to C# as: Outlook.MailItem selItem = _Explorer.Selection(1); But it will not compile - I'd really like to iterate through all selected emails but right now I just need to get the currently selected one. Thanks -- Tom Hamilton Hamilton & Hamilton Database Consulting Services Sacramento, CA "Ken Slovak - [MVP - Outlook]" wrote: Use ActiveExplorer.CurrentFolder.Items to get the collection of items in the folder (if the Inbox is currently being displayed). Otherwise use NameSpace.GetDefaultFolder(olFolderInbox).Items to get that collection. Iterate the collection and retrieve whatever properties you want from each item. Make sure to test for item.Class = olMail if you are only interested in mail items. -- 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 "DMc2004" wrote in message ... How can I retrieve information such as Sender, Recipient, Subject, Sent Date, Mail Size from the Inbox of Microsoft Office Outlook 2003? Regards D |
#4
|
|||
|
|||
![]()
Never mind - C# indexes with [] which is why () didn't work....
What's the best way to Loop thru Selection? -- Tom Hamilton Hamilton & Hamilton Database Consulting Services Sacramento, CA "Tom Hamilton" wrote: Hi Ken, I'm having problem following the suggestion you offer. I'm converting an Outlook 2003 add-in that I prototyped in vb using VS2005. The problem is identifying the currently selected mail item. in vb I was using : Dim selItem As Outlook.MailItem = _Explorer.Selection(1) I converted to C# as: Outlook.MailItem selItem = _Explorer.Selection(1); But it will not compile - I'd really like to iterate through all selected emails but right now I just need to get the currently selected one. Thanks -- Tom Hamilton Hamilton & Hamilton Database Consulting Services Sacramento, CA "Ken Slovak - [MVP - Outlook]" wrote: Use ActiveExplorer.CurrentFolder.Items to get the collection of items in the folder (if the Inbox is currently being displayed). Otherwise use NameSpace.GetDefaultFolder(olFolderInbox).Items to get that collection. Iterate the collection and retrieve whatever properties you want from each item. Make sure to test for item.Class = olMail if you are only interested in mail items. -- 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 "DMc2004" wrote in message ... How can I retrieve information such as Sender, Recipient, Subject, Sent Date, Mail Size from the Inbox of Microsoft Office Outlook 2003? Regards D |
#5
|
|||
|
|||
![]()
It depends on what you're doing inside the loop and what sort of objects
you're dealing with. For deleting or moving items in a loop you should use a down counting loop so changes to the collection's count don't mess with the loop indexing. So a for loop that starts at Selection.Count (use an int variable to pick that up and don't use Selection.Count in the loop) and works down to 1 would work. A do loop can also be used that checks for a Selection.Count of 0. For anything else you can use any sort of loop construct you're most comfortable with. That can be a for loop, do loop, foreach loop or whatever. -- 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 "Tom Hamilton" wrote in message ... Never mind - C# indexes with [] which is why () didn't work.... What's the best way to Loop thru Selection? -- Tom Hamilton Hamilton & Hamilton Database Consulting Services Sacramento, CA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Retrieving information | Donteathecheese | Outlook - Using Forms | 5 | March 25th 08 08:51 PM |
Retrieving mail from server | Poor Richard | Outlook Express | 0 | October 6th 06 11:44 PM |
Retrieving information from incomming mail items. | Jan G. Thorstensen | Outlook and VBA | 1 | September 18th 06 06:45 AM |
Error 0x80042108 retrieving POP3 Mail | pee | Outlook - General Queries | 0 | August 5th 06 05:48 PM |
stokp out look from retrieving mail while off` | sacredarms | Outlook - General Queries | 1 | April 18th 06 04:02 AM |