Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-06-2012, 04:10 PM
MattMurdock MattMurdock is offline Email macro to read range for .To field Windows 7 64bit Email macro to read range for .To field Office 2010 64bit
Novice
Email macro to read range for .To field
 
Join Date: Jul 2012
Posts: 5
MattMurdock is on a distinguished road
Default Email macro to read range for .To field

Hi guys I have an email macro that creates its .To field with a long list of email addresses in a column. My problem is that it seems the .To field only seems to be able to read one cell at a time. Is there a workaround available besides using CONCATENATE? This list is for over 50 addresses and that would be very annoying.



Heres my code

Code:
Sub PackagingtoMDEmail()
    Dim OutApp As Object
    Dim OutMail As Object
    Dim strbody As String
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
   
  Call SaveAs
  UserForm1.Show
  
    On Error Resume Next
    With OutMail
        .To = Range("A58:A120")
        .CC = ""
        .BCC = ""
        .Subject = "PIN REQUEST-" & Range("C16").Value & " " & Range("N15")
        .Body = ActiveSheet.TextBox1
    If Range("N15").Value = "***RUSH" Then
        .Importance = 2
        .Priority = 2
    End If
        .display
        .Attachments.Add ActiveWorkbook.FullName
    End With
    On Error GoTo 0
    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub
Reply With Quote
  #2  
Old 08-07-2012, 03:52 AM
OTPM OTPM is offline Email macro to read range for .To field Windows 7 32bit Email macro to read range for .To field Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi Matt

Have a look at this link which should help you.

http://www.ozgrid.com/forum/showthread.php?t=161209

Good luck.

Tony
Reply With Quote
  #3  
Old 08-07-2012, 06:46 AM
MattMurdock MattMurdock is offline Email macro to read range for .To field Windows 7 64bit Email macro to read range for .To field Office 2010 64bit
Novice
Email macro to read range for .To field
 
Join Date: Jul 2012
Posts: 5
MattMurdock is on a distinguished road
Default

Thanks it worked! I appreciate it
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Email macro to read range for .To field Macro to read word document harishankar.selvaraju Excel Programming 1 06-14-2012 03:48 AM
Summation where range vary using Macro halogen_bulb Excel Programming 2 11-15-2011 05:38 AM
Email macro to read range for .To field Print Macro w/ Page Range? stickyit Outlook 1 10-06-2011 09:51 AM
Email macro to read range for .To field Generic range for custom sort macro? tswiers Excel Programming 2 08-11-2011 02:40 AM
Email macro to read range for .To field marking email as "read" until email is read on local device. mwomack Outlook 2 07-16-2011 08:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft