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 » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Item.Recipients.Add Not Working for me



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 25th 06, 09:04 PM posted to microsoft.public.outlook.program_forms
[email protected]
external usenet poster
 
Posts: 12
Default Item.Recipients.Add Not Working for me

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
")
blnOKToSend = True
MsgBox "The current to list is: " & Item.To
End If
Item_Send = False
End Function
  #2  
Old April 26th 06, 02:54 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Item.Recipients.Add Not Working for me

Does it work better if you instantiate a Recipient object and then resolve
it?

Set oRecip = ")
oRecip.Resolve

--
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


" wrote in
message ...
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
")
blnOKToSend = True
MsgBox "The current to list is: " & Item.To
End If
Item_Send = False
End Function


  #3  
Old April 26th 06, 03:42 PM posted to microsoft.public.outlook.program_forms
[email protected]
external usenet poster
 
Posts: 12
Default Item.Recipients.Add Not Working for me

Ken,

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

Thank you,
Jeff Riley

"Ken Slovak - [MVP - Outlook]" wrote:

Does it work better if you instantiate a Recipient object and then resolve
it?

Set oRecip = ")
oRecip.Resolve

--
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


" wrote in
message ...
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
")
blnOKToSend = True
MsgBox "The current to list is: " & Item.To
End If
Item_Send = False
End Function



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add Custom Header Mail Item [email protected] Outlook - General Queries 2 April 4th 06 10:45 AM
How to add Custom Header to Mail Item racni Add-ins for Outlook 2 April 4th 06 10:36 AM
Item.Recipients.Add Ian Sweeney Outlook and VBA 5 March 23rd 06 10:27 PM
How do I add an item that isn't an appointment? smags Outlook - Calandaring 1 March 22nd 06 06:35 PM
add toolbar in inspector contact item Irene Outlook and VBA 1 February 24th 06 09:23 PM


All times are GMT +1. The time now is 11:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.