Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / November 2007

Tip: Looking for answers? Try searching our database.

recipients from a MAPITABLE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stèphan Eizinga - 29 Nov 2007 14:29 GMT
Hello,

I want to collect the recipients from a mail message.

We use this SQL query in MAPITable.ExecSQL "SELECT
Recipients,Body,SenderEmailType,SenderEmailAddress FROM Folder"

If this QUERY is correct, how can I get the items from Recipients?

I use the latest Outlook Redemption v. 4.4 and PowerBuilder 11.1

- BEGIN POWERBUILDER CODE -
loo_ADOrecordset    = io_folder.Items.MAPITable.ExecSQL('SELECT
Recipients,Body,SenderEmailType,SenderEmailAddress FROM Folder')

DO WHILE (loo_ADOrecordset.EOF = FALSE)
    // How can I read this out?
    st_recipients    = loo_ADOrecordset.Fields.Item("Recipients").Value
    // Working correct!
    st_sendermail    =
loo_ADOrecordset.Fields.Item("SenderEmailAddress").Value

    loo_ADOrecordset.MoveNext()
LOOP
- END POWERBUILDER CODE -

King regards,
Stèphan Eizinga
Ken Slovak - [MVP - Outlook] - 29 Nov 2007 16:03 GMT
Recipients is a collection, not a property. You need to get the actual
message and retrieve and iterate the Recipients collection for what you
want. Get the EntryID of the item in question and use that to get the email
object and then retrieve and iterate the Recipients collection.

The same would apply to any other collection such as Attachments.

If you just want whatever is in the To, Cc and Bcc fields you can use those
string properties but those may not be what you want. They could return
display names or email addresses or a mix of both for any one recipient and
for a received email the Bcc field will always be blank of course.

Signature

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

Hello,

I want to collect the recipients from a mail message.

We use this SQL query in MAPITable.ExecSQL "SELECT
Recipients,Body,SenderEmailType,SenderEmailAddress FROM Folder"

If this QUERY is correct, how can I get the items from Recipients?

I use the latest Outlook Redemption v. 4.4 and PowerBuilder 11.1

- BEGIN POWERBUILDER CODE -
loo_ADOrecordset = io_folder.Items.MAPITable.ExecSQL('SELECT
Recipients,Body,SenderEmailType,SenderEmailAddress FROM Folder')

DO WHILE (loo_ADOrecordset.EOF = FALSE)
// How can I read this out?
st_recipients = loo_ADOrecordset.Fields.Item("Recipients").Value
// Working correct!
st_sendermail =
loo_ADOrecordset.Fields.Item("SenderEmailAddress").Value

loo_ADOrecordset.MoveNext()
LOOP
- END POWERBUILDER CODE -

King regards,
Stèphan Eizinga
Dmitry Streblechenko - 29 Nov 2007 16:34 GMT
In addition to what Ken said, also keep in mind that even though recipient
and attachment data cannot be directly retrieved from a table, you can still
create restrictions based on recipients and attachments (the WHERE clause).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

> Recipients is a collection, not a property. You need to get the actual
> message and retrieve and iterate the Recipients collection for what you
[quoted text clipped - 37 lines]
> King regards,
> Stèphan Eizinga
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.