Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Help with Send e-mail

Hi all, i am not a programme but a dabbler and need help with the following.
I have a spreedsheet were i have a list of names (There could be duplicates)
i then need to take one instance of each name, look up the e-mail address and
send the same e-mail to them all...

Could anybody help me with this please ??
--
Les
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Help with Send e-mail

On May 3, 12:46 pm, Les wrote:
Hi all, i am not a programme but a dabbler and need help with the following.
I have a spreedsheet were i have a list of names (There could be duplicates)
i then need to take one instance of each name, look up the e-mail address and
send the same e-mail to them all...

Could anybody help me with this please ??
--
Les


Give us some more info about the layout of your sheet. For instance
where is the email you'll be looking up?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Help with Send e-mail

Please Ignore this thread, i have the answer...

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Help with Send e-mail

http://www.rondebruin.nl/sendmail.htm

should get you started. I don't recall if it has the lookup the email
address part, but then again it isn't clear where you want it to look up the
email address.

--
Regards,
Tom Ogilvy


"Les" wrote:

Hi all, i am not a programme but a dabbler and need help with the following.
I have a spreedsheet were i have a list of names (There could be duplicates)
i then need to take one instance of each name, look up the e-mail address and
send the same e-mail to them all...

Could anybody help me with this please ??
--
Les

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Help with Send e-mail

I have one link to a example on this page Tom
http://www.rondebruin.nl/mail/folder3/message.htm

Tip from Patrick and changed by you and me in 2004
http://www.rondebruin.nl/files/messageunique.txt


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Tom Ogilvy" wrote in message ...
http://www.rondebruin.nl/sendmail.htm

should get you started. I don't recall if it has the lookup the email
address part, but then again it isn't clear where you want it to look up the
email address.

--
Regards,
Tom Ogilvy


"Les" wrote:

Hi all, i am not a programme but a dabbler and need help with the following.
I have a spreedsheet were i have a list of names (There could be duplicates)
i then need to take one instance of each name, look up the e-mail address and
send the same e-mail to them all...

Could anybody help me with this please ??
--
Les



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Help with Send e-mail

Hi Ron, I used your code below but get an error, am i doing something
wrong or a setting perhaps ?

With my cursor on "cell.value" i get the message <Object Variable or
With Block Variable not set

Dim cell As Range
Dim strto As String
On Error Resume Next
For Each cell In ThisWorkbook.Sheets("Sheet1") _
.Range("A1:A10").Cells.SpecialCells(xlCellTypeCons tants)
If cell.Value Like "?*@?*.?*" Then
strto = strto & cell.Value & ";"
End If
Next cell
On Error GoTo 0
If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1)

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Help with Send e-mail

Post the complete code Les

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Les Stout" wrote in message ...
Hi Ron, I used your code below but get an error, am i doing something
wrong or a setting perhaps ?

With my cursor on "cell.value" i get the message <Object Variable or
With Block Variable not set

Dim cell As Range
Dim strto As String
On Error Resume Next
For Each cell In ThisWorkbook.Sheets("Sheet1") _
.Range("A1:A10").Cells.SpecialCells(xlCellTypeCons tants)
If cell.Value Like "?*@?*.?*" Then
strto = strto & cell.Value & ";"
End If
Next cell
On Error GoTo 0
If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1)

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Help with Send e-mail

Hi Ron, herewith is the complete code....

Sub emailToAll()
'
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, ccAdd As String, Subj As String
Dim BodyText As String, contact As String, comment As String
Dim myComm As Integer, cell As Range
Application.ScreenUpdating = True
'------------------ E-mail address
------------------------------------------------------
On Error Resume Next
For Each cell In ThisWorkbook.Sheets("New gams") _
.Range("T2:T100").Cells.SpecialCells(xlCellTypeCon stants)
If cell.Value Like "?*@?*.?*" Then
strto = strto & cell.Value & ";"
End If
Next cell
On Error GoTo 0
If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1)

'------------------ CC E-mail address
---------------------------------------------------

ccAdd = "DL-ZA-GAMSCC;record kevin, ZA-T-M-22;stout les, ZA-T-M-22"

'------------------ Get the contact persons Surname name
--------------------------------

Subj = "Weekly gAMS Report " & Format(Date, "dd/mm/yy")
With ThisWorkbook.ActiveSheet
BodyText = "Good Day all, " & vbNewLine & vbNewLine & _
"Please find attached the latest gAMS report." &
vbNewLine & vbNewLine & _
" • This report is for new gAMS Documents that
were not created by or allocated to ZA-T-M." & vbNewLine & vbNewLine & _
" • Please open the attachment and refer to the
UPG responsibilities per department on the right of the spreadsheet." &
vbNewLine & vbNewLine & _
" • Then check in the gAMS system to check if it
is valid for you or not, if it is valid for W.9 and you require " &
vbNewLine & _
" funds or an action, you will be required to
contact your CoC or the gAMS Prime Mover to action an AFO." & vbNewLine
& vbNewLine & vbNewLine & vbNewLine & _
"**** Should a UPG be allocated incorrectly or changed,
please advise Les Stout of the changes. ****" & vbNewLine & vbNewLine &
vbNewLine & _
"If you have any queries regarding this document, please
contact the sender." & vbNewLine & vbNewLine & vbNewLine & _
"Best Regards," & vbNewLine & vbNewLine & _
"gAMS_Auto_Macro" & vbNewLine & vbNewLine & _
"ZA-T-M-22" & vbNewLine & vbNewLine & _
"Please Note:" & vbNewLine & _
"The attachment and this e-mail are generated
automatically"
End With
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = strto
.CC = ccAdd
.BCC = ""
.Subject = Subj
.Body = BodyText
.ReadReceiptRequested = True
.Importance = 2
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
chkWkbToCloseGams
End Sub


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Help with Send e-mail

Strange with a on error resume next above it ?
Do you have the code in your workbook or in the personal.xls

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Les Stout" wrote in message ...
Hi Ron, herewith is the complete code....

Sub emailToAll()
'
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, ccAdd As String, Subj As String
Dim BodyText As String, contact As String, comment As String
Dim myComm As Integer, cell As Range
Application.ScreenUpdating = True
'------------------ E-mail address
------------------------------------------------------
On Error Resume Next
For Each cell In ThisWorkbook.Sheets("New gams") _
.Range("T2:T100").Cells.SpecialCells(xlCellTypeCon stants)
If cell.Value Like "?*@?*.?*" Then
strto = strto & cell.Value & ";"
End If
Next cell
On Error GoTo 0
If Len(strto) 0 Then strto = Left(strto, Len(strto) - 1)

'------------------ CC E-mail address
---------------------------------------------------

ccAdd = "DL-ZA-GAMSCC;record kevin, ZA-T-M-22;stout les, ZA-T-M-22"

'------------------ Get the contact persons Surname name
--------------------------------

Subj = "Weekly gAMS Report " & Format(Date, "dd/mm/yy")
With ThisWorkbook.ActiveSheet
BodyText = "Good Day all, " & vbNewLine & vbNewLine & _
"Please find attached the latest gAMS report." &
vbNewLine & vbNewLine & _
" . This report is for new gAMS Documents that
were not created by or allocated to ZA-T-M." & vbNewLine & vbNewLine & _
" . Please open the attachment and refer to the
UPG responsibilities per department on the right of the spreadsheet." &
vbNewLine & vbNewLine & _
" . Then check in the gAMS system to check if it
is valid for you or not, if it is valid for W.9 and you require " &
vbNewLine & _
" funds or an action, you will be required to
contact your CoC or the gAMS Prime Mover to action an AFO." & vbNewLine
& vbNewLine & vbNewLine & vbNewLine & _
"**** Should a UPG be allocated incorrectly or changed,
please advise Les Stout of the changes. ****" & vbNewLine & vbNewLine &
vbNewLine & _
"If you have any queries regarding this document, please
contact the sender." & vbNewLine & vbNewLine & vbNewLine & _
"Best Regards," & vbNewLine & vbNewLine & _
"gAMS_Auto_Macro" & vbNewLine & vbNewLine & _
"ZA-T-M-22" & vbNewLine & vbNewLine & _
"Please Note:" & vbNewLine & _
"The attachment and this e-mail are generated
automatically"
End With
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = strto
.CC = ccAdd
.BCC = ""
.Subject = Subj
.Body = BodyText
.ReadReceiptRequested = True
.Importance = 2
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
chkWkbToCloseGams
End Sub


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Help with Send e-mail

Hi Ron,sorry for the delay in reply, i have the code in my workbook. The
portion of code that i posted earlier was from your tips below.

http://www.rondebruin.nl/mail/tips2.htm


Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Help with Send e-mail

Hello Ron, as i suspected the error was on my side, i was not pointing
to the workbook where the range was. It is now working 100%, thank
you...

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Help with Send e-mail

Ok, good to hear that it is working now


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Les Stout" wrote in message ...
Hello Ron, as i suspected the error was on my side, i was not pointing
to the workbook where the range was. It is now working 100%, thank
you...

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bypass: A program is trying to send mail using Item.Send prompt Vick Excel Discussion (Misc queries) 1 June 25th 09 03:31 AM
Send e-mail Andrea Excel Discussion (Misc queries) 3 March 25th 07 12:37 PM
A program is trying to send mail using Item.Send David Gerstman Excel Programming 4 December 5th 06 06:31 PM
Use CDO to send e-mail Rob Excel Programming 2 September 13th 06 03:39 PM
Send e-mail with CDO Luciano Excel Programming 0 January 12th 05 09:15 AM


All times are GMT +1. The time now is 12:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"