LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Extracting all Email addresses from an Outlook folder "Undeliverables"

See if what I've got between the lines gives you a start. In this case, the
routine looks at the body of each message in the Inbox subfolder named
"undeliverables" and if a line containing the @ symbol is found, the line
comes up in a message box. I'm assuming you will be listing such lines on a
worksheet instead but you said you could handle the Excel portion.

'------------------------------------

Sub CheckUndeliverables()

Const olFolderInbox = 6

Dim strBody As String

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objInbox = objNamespace.GetDefaultFolder(olFolderInbox)
Set objFolder = objInbox.Folders("Undeliverables")

Set colItems = objFolder.Items

For Each objItem In colItems
strBody = objItem.Body
arrLines = Split(strBody, vbCrLf)
For x = 0 To UBound(arrLines)
If InStr(arrLines(x), "@") 0 Then
MsgBox arrLines(x)
End If
Next x
Next objItem

Set objFolder = Nothing
Set objInbox = Nothing
Set objNamespace = Nothing
Set objOutlook = Nothing
End Sub


'------------------------------------

Steve Yandl



wrote in message
...
I collect all my undeliverable sent Emails in an (Outlook) Inbox
folder named "Undeliverables".
I 'd like to open them one by one and list the addresses up on an
Excel sheet.
My VBA knowledge will do for the Excel part but not for the Outlook
part.
Can you help me? Maybe there is already a posting on this subject but
I couldn't find it.
Thank you very much.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get email addresses to be "hot" when using lookup bsharp Excel Worksheet Functions 3 May 13th 09 02:30 PM
"Send Email" macro to multiple addresses LKP Excel Programming 16 November 3rd 08 09:08 PM
Excel Macro to email to addresses in "Contacts" Tab Appelq Excel Programming 7 August 14th 06 05:51 PM
copy/convert column email addresses Hyperlink "mailto:" excel97 daleman101 Excel Discussion (Misc queries) 3 November 3rd 05 01:21 PM
Extracting email addresses from Outlook Contacts Todd Huttenstine[_2_] Excel Programming 3 January 12th 04 02:58 AM


All times are GMT +1. The time now is 09:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"