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

MAcro - Need help in getting the recipients in to filed / cc field toput in an array



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 18th 09, 06:11 PM posted to microsoft.public.outlook.program_vba
Shreekanth Murali
external usenet poster
 
Posts: 7
Default MAcro - Need help in getting the recipients in to filed / cc field toput in an array


This is the macro to stop sending without a subject as well as to warn the user whn he sends to the distribution list that starts with "#"
However this code detects the email addresses in TO / CC as one single string.

For eg if i have

shreekanth Murali; #IN - distribution

then it detects "shreekanth murali; #in - distribution" and not warning the presence of a distributon list in TO field... Im a beginner please lemme know how can i do it


Private Sub Application_ItemSend(ByVal item As Object, Cancel As Boolean)

Dim strSubject As String

strSubject = item.Subject

If Len(Trim(strSubject)) = 0 Then

Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?"

If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then

Cancel = True

End If

End If


Dim a

Dim b





a = Mid(item.To, 1, 1)

If a = "#" Then

Prompt$ = "You are about to send an email to the distribution list " & item.To

If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Recipient is a distribution list") = vbNo Then

Cancel = True

End If



End If


End Sub


Submitted via EggHeadCafe - Software Developer Portal of Choice
CSS Stylesheet Sampler Script
http://www.eggheadcafe.com/tutorials...ampler-sc.aspx
  #2  
Old December 18th 09, 06:48 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default MAcro - Need help in getting the recipients in to filed / cc field to put in an array

Instead of using To/CC/BCC properties, loop through all the recipients in
the MailItem.Recipients collection.

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

This is the macro to stop sending without a subject as well as to warn the
user whn he sends to the distribution list that starts with "#"
However this code detects the email addresses in TO / CC as one single
string.

For eg if i have

shreekanth Murali; #IN - distribution

then it detects "shreekanth murali; #in - distribution" and not warning
the presence of a distributon list in TO field... Im a beginner please
lemme know how can i do it


Private Sub Application_ItemSend(ByVal item As Object, Cancel As Boolean)

Dim strSubject As String

strSubject = item.Subject

If Len(Trim(strSubject)) = 0 Then

Prompt$ = "Subject is Empty. Are you sure you want to send the
Mail?"

If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground,
"Check for Subject") = vbNo Then

Cancel = True

End If

End If


Dim a

Dim b





a = Mid(item.To, 1, 1)

If a = "#" Then

Prompt$ = "You are about to send an email to the distribution list " &
item.To

If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground,
"Recipient is a distribution list") = vbNo Then

Cancel = True

End If



End If


End Sub


Submitted via EggHeadCafe - Software Developer Portal of Choice
CSS Stylesheet Sampler Script
http://www.eggheadcafe.com/tutorials...ampler-sc.aspx



  #3  
Old December 19th 09, 04:14 PM posted to microsoft.public.outlook.program_vba
Shreekanth Murali
external usenet poster
 
Posts: 7
Default example please

Can you please guide me by giving me an example how to use this.... I am sorry i need to agree that i have just started to learn... i need your help please... we are gonna apply this for our people in my company...



Dmitry Streblechenko wrote:

Instead of using To/CC/BCC properties, loop through all the recipients inthe
18-Dec-09

Instead of using To/CC/BCC properties, loop through all the recipients in
the MailItem.Recipients collection.

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

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
ASP.NET Digest Authentication Against Database
http://www.eggheadcafe.com/tutorials...uthentica.aspx
  #4  
Old December 21st 09, 03:40 AM posted to microsoft.public.outlook.program_vba
Shreekanth Murali
external usenet poster
 
Posts: 7
Default item.recipients.Count

item.recipients.Count gives me number of recipients in the mail. How can i get the details of that . What should i user.

eg: I have three email address in to field and for testing purpose i wrote msgbox(item.recipients.count)
and this gave me 3 in the msgbox. Now how can get the recipients? i can create a loop but what property should i use to extract this ?

iam using O2k3



Shreekanth Murali wrote:

example please
19-Dec-09

Can you please guide me by giving me an example how to use this.... I am sorry i need to agree that i have just started to learn... i need your help please... we are gonna apply this for our people in my company...

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Toward Viable CAPTCHA Alternatives
http://www.eggheadcafe.com/tutorials...ptcha-alt.aspx
  #5  
Old December 21st 09, 04:55 AM posted to microsoft.public.outlook.program_vba
Shreekanth Murali
external usenet poster
 
Posts: 7
Default I Found it --item.recipients.item(i).AddressEntry

Hey I found it


its item.recipients.item(i).AddressEntry


THANKS A LOT FOR YOUR INFORMATION.



Shreekanth Murali wrote:

item.recipients.Count
20-Dec-09

item.recipients.Count gives me number of recipients in the mail. How can i get the details of that . What should i user.

eg: I have three email address in to field and for testing purpose i wrote msgbox(item.recipients.count)
and this gave me 3 in the msgbox. Now how can get the recipients? i can create a loop but what property should i use to extract this ?

iam using O2k3

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
axWebBrowser1.Navigate Auto Page Loader In A Real Browser
http://www.eggheadcafe.com/tutorials...vigate-au.aspx
 




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
Outlook 2007 To field not caching recipients mdlister Outlook - General Queries 5 July 2nd 09 10:46 AM
How do I change data in a field across an array of contacts? Max's Dad in Traverse Outlook - Using Contacts 1 January 11th 08 07:45 PM
All recipients aren't showing up in the To: field fielix Outlook - General Queries 3 June 25th 07 03:45 PM
Sending to specific recipients, field populates with time/date? faeriegirl Outlook - Using Forms 3 July 28th 06 12:19 AM
Copy and paste recipients list into To field of new email message displays as ; [email protected] Outlook - General Queries 0 March 9th 06 05:19 PM


All times are GMT +1. The time now is 08:23 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.