try this see if it helps Sub Scan_my_outlook_inbox() 'TOOLS ->Refrence -> microsoft outlook 'declare outlook objects Dim olapp As Outlook.Application Dim olappns As Outlook.Namespace Dim oinbox As Outlook.Folder Dim oitem As Outlook.MailItem Dim myItems As Outlook.Items Dim i As Long i = 2 'set outlook objects Set olapp = New Outlook.Application Set olappns = olapp.GetNamespace("MAPI") ' it will scan inbox folder only Set oinbox = olappns.GetDefaultFolder(olFolderInbox) ' sort emails on recieved basis Set myItems = oinbox.Items myItems.Sort "[Received]", True
'loop through all unread emails For Each oitem In myItems Sheets("Inbox Scan").Cells(i, 1).Value = oitem.SenderName Sheets("Inbox Scan").Cells(i, 2).Value = oitem.SenderEmailAddress 'Sheets("Inbox Scan").Cells(i, 3).Value = oitem.Subject 'Sheets("Inbox Scan").Cells(i, 4).Value = oitem.Body 'Sheets("Inbox Scan").Cells(i, 5).Value = oitem.ReceivedTime i = i + 1 Next End Sub On Thu, Jul 5, 2012 at 4:39 PM, Rohan Young <rohan.j...@gmail.com> wrote: > Dear Sanjib, > > Its not working & improting i need to import all Mail IDs from My Sent > & Inbox Folder, i need any macro for this > > thanks > > > On Thu, Jul 5, 2012 at 4:01 PM, Sanjib Chatterjee > <chatterjee.kolk...@gmail.com> wrote: > > Just follow follow the link > > > > http://support.microsoft.com/kb/295664 > > > > > > On Thu, Jul 5, 2012 at 3:52 PM, Rohan Young <rohan.j...@gmail.com> > wrote: > >> > >> Dear Group, > >> > >> how can i get all mail IDs from my outlook to excel to make a list of > >> all IDs and Co., please help me out > >> > >> Thanks & Regds > >> > >> ROHAN > >> > >> -- > >> FORUM RULES (986+ members already BANNED for violation) > >> > >> 1) Use concise, accurate thread titles. Poor thread titles, like Please > >> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will > >> not get quick attention or may not be answered. > >> > >> 2) Don't post a question in the thread of another member. > >> > >> 3) Don't post questions regarding breaking or bypassing any security > >> measure. > >> > >> 4) Acknowledge the responses you receive, good or bad. > >> > >> 5) Cross-promotion of, or links to, forums competitive to this forum in > >> signatures are prohibited. > >> > >> NOTE : Don't ever post personal or confidential data in a workbook. > Forum > >> owners and members are not responsible for any loss. > >> > >> > >> > ------------------------------------------------------------------------------------------------------ > >> To post to this group, send email to excel-macros@googlegroups.com > >> > >> To unsubscribe, send a blank email to > >> excel-macros+unsubscr...@googlegroups.com > > > > > > > > > > -- > > - > > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > > To unsubscribe, send a blank email to > excel-macros+unsubscr...@googlegroups.com > -- *Regards* * * *Ashish Koul* *http://www.excelvbamacros.com/* *http://www.accessvbamacros.com/* <http://www.accessvbamacros.com/> P Before printing, think about the environment. -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com