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 Forms / April 2006

Tip: Looking for answers? Try searching our database.

Item.Recipients.Add Not Working for me

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jeff.riley@bp.com - 25 Apr 2006 21:04 GMT
Hello all,

I have the following code but I can not seemt to get it working.  I am still
missing something very basic.  Sue you will see this is still mostly the code
you gave me.  I am just trying to add my email address to the recipients
collection if it is not already there.  My problem is it goes to everyone in
the collection but me.  By the way your book should arrive at my house
tomorrow. ;)  Thanks in advance.

Function Item_Send()
   Dim blnOKToSend
   blnOKToSend = False
   For Each recip in Item.Recipients
       MsgBox "The current recip is: " & recip.Address
       If recip.Address = "/o=BP/ou=USAHOU/cn=Users/cn=rilej3" Then
           blnOKToSend = True
           Exit For
       End If
   Next
   If blnOKToSend = False Then
       Item.Recipients.Add("jeff.riley@bp.com")
       blnOKToSend = True
       MsgBox "The current to list is: " & Item.To
   End If
   Item_Send = False
End Function
Ken Slovak - [MVP - Outlook] - 26 Apr 2006 14:54 GMT
Does it work better if you instantiate a Recipient object and then resolve
it?

Set oRecip = Item.Recipients.Add("jeff.riley@bp.com")
oRecip.Resolve

Signature

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

> Hello all,
>
[quoted text clipped - 25 lines]
>    Item_Send = False
> End Function
jeff.riley@bp.com - 26 Apr 2006 15:42 GMT
Ken,

Thank you so very much.  That was the piece I was missing.  It is working
great now.

Thank you,
Jeff Riley

> Does it work better if you instantiate a Recipient object and then resolve
> it?
[quoted text clipped - 31 lines]
> >    Item_Send = False
> > End Function
 
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



©2010 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.