![]() |
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
|
|||
|
|||
![]()
Hi -
I am trying to extract all of the email addresses I have sent emails to in a folder to a text file. So far I have been able to extract the email address of the person who sent the email (i.e. me) using the SenderEmailAddress property, but when I try to use the Recipients property, I get the error "Run-time error '438': Object doesn't support this property or method." The code I am using is: Sub SetFlagIcon() Dim myOlApp As Outlook.Application Dim mpfInbox As Outlook.MAPIFolder Dim obj As Outlook.MailItem Dim i As Integer Dim s As String Dim sendername1 As String Dim response As Integer Set myOlApp = CreateObject("Outlook.Application") Set mpfInbox = myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFo lderInbox).Folders("Test") ' Loop all items in the Inbox\Test Folder For i = 1 To mpfInbox.Items.Count If mpfInbox.Items(i).Class = olMail Then Set obj = mpfInbox.Items.Item(i) s = obj.SenderEmailAddress 's = obj.Recipients obj.Save MyFile = "c:\nperry4\" & "nperry4.txt" fnum = FreeFile() Open MyFile For Append As fnum Print #fnum, s Close #fnum End If Next End Sub I have commented out the recipients line while I figure it out. Many thanks for any response. Neil |
Ads |
#2
|
|||
|
|||
![]()
Recipients is a collection, not a string property:
Set recips = obj.Recipients For Each recip in Recips MsgBox recip.Address Next -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Neil Perry" wrote in message news ![]() Hi - I am trying to extract all of the email addresses I have sent emails to in a folder to a text file. So far I have been able to extract the email address of the person who sent the email (i.e. me) using the SenderEmailAddress property, but when I try to use the Recipients property, I get the error "Run-time error '438': Object doesn't support this property or method." The code I am using is: Sub SetFlagIcon() Dim myOlApp As Outlook.Application Dim mpfInbox As Outlook.MAPIFolder Dim obj As Outlook.MailItem Dim i As Integer Dim s As String Dim sendername1 As String Dim response As Integer Set myOlApp = CreateObject("Outlook.Application") Set mpfInbox = myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFo lderInbox).Folders("Test") ' Loop all items in the Inbox\Test Folder For i = 1 To mpfInbox.Items.Count If mpfInbox.Items(i).Class = olMail Then Set obj = mpfInbox.Items.Item(i) s = obj.SenderEmailAddress 's = obj.Recipients obj.Save MyFile = "c:\nperry4\" & "nperry4.txt" fnum = FreeFile() Open MyFile For Append As fnum Print #fnum, s Close #fnum End If Next End Sub I have commented out the recipients line while I figure it out. Many thanks for any response. Neil |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
group recipients and naming of sender - recipients | nip | Outlook - General Queries | 10 | September 4th 09 01:36 PM |
OL 2003: Reading pane not available for DRAFTS folder | Andrew Hamilton | Outlook - General Queries | 1 | November 19th 08 05:30 AM |
How can I send emails to multiple recipients & how many Recipients | Cusie | Outlook - Using Contacts | 2 | November 2nd 07 10:07 PM |
Inbox Mail disappears after reading and leaving the folder! | KILROY | Outlook - Installation | 3 | January 15th 07 05:41 PM |
how can i move a messeage to a certain folder before reading it? | Bilal | Outlook - Installation | 1 | February 22nd 06 12:24 PM |