A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: ,

Use of SafeRecipients





 
 
Thread Tools Display Modes
  #1  
Old February 2nd 06, 12:05 PM posted to microsoft.public.outlook.program_addins
Jonatan
external usenet poster
 
Posts: 2
Default Use of SafeRecipients

Hi all,

I have started to use Redemption today and I am getting a problem that
is quite likely to be my fault!!

I just want to display the AddressBook select recipients and send the
email. For some reason the safeMailItem recipients list does not get
updated and the program fails with error 0x80004005.

I suppose that I do not need to loop through the returned list of
recipients and populate the recipients list of the SafeMailItem!!!

My code is the following


Outlook.MailItem mailItem = (Outlook.MailItem)
this.CreateItem(Microsoft.Office.Interop.Outlook.O lItemType.olMailItem);

Redemption.SafeMailItem sMailItem = new
Redemption.SafeMailItem();

mailItem.Subject = "Hello";

sMailItem.Item = mailItem;

Redemption.MAPIUtils mapiUtils = new
Redemption.MAPIUtils();
Redemption.SafeRecipients recipients =
sMailItem.Recipients;

recipients = (Redemption.SafeRecipients)
mapiUtils.AddressBook(recipients, "Select Name", false, true, 3, "To",
"Cc", "Bcc", 0);

//This method displays 1 if I selected one recipient
MessageBox.Show("" + recipients.Count);

// This one displays always 0
MessageBox.Show("" + sMailItem.Recipients.Count);

// As a result when I send the item it fails because
there are no recipients
sMailItem.Send();

Thank you for your help

Jonatan

Ads
  #2  
Old February 2nd 06, 12:48 PM posted to microsoft.public.outlook.program_addins
Jonatan
external usenet poster
 
Posts: 2
Default Use of SafeRecipients

Hi all,

I realised that the recipients object returned by the AddressBook is a
copy so I need to update the Recipients from the SafeMailItem.

How can I do that without going though one by one?

  #3  
Old February 2nd 06, 04:29 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Use of SafeRecipients

You will need to iterate the SafeRecipients collection. It would be the same if you were using CDO and Session.AddressBook.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Jonatan" wrote in message oups.com...
Hi all,

I realised that the recipients object returned by the AddressBook is a
copy so I need to update the Recipients from the SafeMailItem.

How can I do that without going though one by one?

  #4  
Old February 2nd 06, 04:30 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,736
Default Use of SafeRecipients

You need to get the Recipients collection of the SafeMailItem as
SafeRecipients, and then one by one add the returned recipients to that
SafeRecipients collection, using the Add or AddEx methods of the
SafeRecipients collection.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Jonatan" wrote in message
oups.com...
Hi all,

I realised that the recipients object returned by the AddressBook is a
copy so I need to update the Recipients from the SafeMailItem.

How can I do that without going though one by one?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Credit Card Application - Online Advertising - Books - Loans - Web Advertising