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

refer to "To" Field in Code



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 7th 06, 02:35 AM posted to microsoft.public.outlook.program_vba
Joel
external usenet poster
 
Posts: 48
Default refer to "To" Field in Code

Hello Sue:

Of course I did try it and it works just fine. I guess I was just asking
about the concepts of addressing the collections properly and if the code
made sense from a conceptial perspective...actually runnning it of course
proves the issue.

Anyway, works fine and thanks for your help and direction.

Joel

"Sue Mosher [MVP-Outlook]" wrote:

Why not try it and see for yourself? If it modifies only half the items, we can switch from the For Each loop to a countdown loop.

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

"Joel" wrote in message ...
I think I got it Sue, what do you think???

Sub Send_Attachment_Messages()

Dim oFolder As Outlook.MAPIFolder
Dim Items As Outlook.Items
Dim objItem As MailItem
Dim Recips As Recipients
Dim Recip As Recipient

Set Items =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderOutbox).Items
For Each objItem In Items
Set Recips = objItem.Recipients
For Each Recip In Recips

If Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\115.xls")
objItem.Send

ElseIf Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\116.xls")
objItem.Send

ElseIf Recip.Address = " Then
objItem.Attachments.Add ("C:\copper\118.xls")
objItem.Send


End If
Next
Next
End Sub



 




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
If the control has a field assigned, the code "_click()" doesn't w Arturo Outlook - Using Forms 1 October 18th 06 01:24 PM
How to set holidays as "Out of office" in "Show time as" field? TFS Outlook - Calandaring 0 May 22nd 06 03:40 PM
DO NOT include field "Title" in the name column in "To" search Rob G. Outlook - Using Contacts 7 May 3rd 06 08:47 PM
Removing unwanted "Auto Complete" addresses from the "To:" field? Pilgrim Outlook - General Queries 1 May 1st 06 07:15 PM
"Percent" field changed to "Number" field Vaughan Outlook - Using Forms 1 March 14th 06 01:32 PM


All times are GMT +1. The time now is 03:42 PM.


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.