Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default email to each person with attachment

Dear all,

I have excel spreadsheet:
In column A the names of the people
In column B the e-mail Addresses
In column C the Filenames like this C:\Data\Book2.xls This don't have to be
Excel files.

I have the Macro wich loop through each row in Sheet1 and if there is a
E-mail address
and a filename that exist in that row it will create a mail with this
information and send it.

Sub TestFile()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim cell As Range
Application.ScreenUpdating = False
Set olApp = New Outlook.Application
For Each cell In
Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants)
If cell.Offset(0, 1).Value < "" Then
If cell.Value Like "*@*" And Dir(cell.Offset(0, 1).Value) < ""
Then
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = cell.Value
.Subject = "Testfile"
.Body = "Hi " & cell.Offset(0, -1).Value
.Attachments.Add cell.Offset(0, 1).Value
.Send 'Or use Display
End With
Set olMail = Nothing
End If
End If
Next cell
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub

Problem is that for each sending of e-mail it is necessary confirmation and
I have to press button "YES".
How I can avoid pressing on "YES" and to send everything automatically.

Best wishes,
Lado



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default email to each person with attachment

See this part of my site
http://www.rondebruin.nl/sendmail.htm#Prevent

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Kiknadze Lado" wrote in message ...
Dear all,

I have excel spreadsheet:
In column A the names of the people
In column B the e-mail Addresses
In column C the Filenames like this C:\Data\Book2.xls This don't have to be
Excel files.

I have the Macro wich loop through each row in Sheet1 and if there is a
E-mail address
and a filename that exist in that row it will create a mail with this
information and send it.

Sub TestFile()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim cell As Range
Application.ScreenUpdating = False
Set olApp = New Outlook.Application
For Each cell In
Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants)
If cell.Offset(0, 1).Value < "" Then
If cell.Value Like "*@*" And Dir(cell.Offset(0, 1).Value) < ""
Then
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = cell.Value
.Subject = "Testfile"
.Body = "Hi " & cell.Offset(0, -1).Value
.Attachments.Add cell.Offset(0, 1).Value
.Send 'Or use Display
End With
Set olMail = Nothing
End If
End If
Next cell
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub

Problem is that for each sending of e-mail it is necessary confirmation and
I have to press button "YES".
How I can avoid pressing on "YES" and to send everything automatically.

Best wishes,
Lado





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default email to each person with attachment

Thank you for your answer.
I'm using MS Outlook and I couldn't find how to uncheck this option.

Best,
Lado

"Ron de Bruin" wrote in message
...
See this part of my site
http://www.rondebruin.nl/sendmail.htm#Prevent

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Kiknadze Lado" wrote in message

...
Dear all,

I have excel spreadsheet:
In column A the names of the people
In column B the e-mail Addresses
In column C the Filenames like this C:\Data\Book2.xls This don't have

to be
Excel files.

I have the Macro wich loop through each row in Sheet1 and if there is a
E-mail address
and a filename that exist in that row it will create a mail with this
information and send it.

Sub TestFile()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim cell As Range
Application.ScreenUpdating = False
Set olApp = New Outlook.Application
For Each cell In
Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants)
If cell.Offset(0, 1).Value < "" Then
If cell.Value Like "*@*" And Dir(cell.Offset(0, 1).Value) <

""
Then
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = cell.Value
.Subject = "Testfile"
.Body = "Hi " & cell.Offset(0, -1).Value
.Attachments.Add cell.Offset(0, 1).Value
.Send 'Or use Display
End With
Set olMail = Nothing
End If
End If
Next cell
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub

Problem is that for each sending of e-mail it is necessary confirmation

and
I have to press button "YES".
How I can avoid pressing on "YES" and to send everything automatically.

Best wishes,
Lado







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default email to each person with attachment

Read good!!

For Outlook see this webpage
http://www.dimastr.com/redemption/
OR Express ClickYes
http://www.express-soft.com/mailmate/clickyes.html


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Kiknadze Lado" wrote in message ...
Thank you for your answer.
I'm using MS Outlook and I couldn't find how to uncheck this option.

Best,
Lado

"Ron de Bruin" wrote in message
...
See this part of my site
http://www.rondebruin.nl/sendmail.htm#Prevent

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Kiknadze Lado" wrote in message

...
Dear all,

I have excel spreadsheet:
In column A the names of the people
In column B the e-mail Addresses
In column C the Filenames like this C:\Data\Book2.xls This don't have

to be
Excel files.

I have the Macro wich loop through each row in Sheet1 and if there is a
E-mail address
and a filename that exist in that row it will create a mail with this
information and send it.

Sub TestFile()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim cell As Range
Application.ScreenUpdating = False
Set olApp = New Outlook.Application
For Each cell In
Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants)
If cell.Offset(0, 1).Value < "" Then
If cell.Value Like "*@*" And Dir(cell.Offset(0, 1).Value) <

""
Then
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = cell.Value
.Subject = "Testfile"
.Body = "Hi " & cell.Offset(0, -1).Value
.Attachments.Add cell.Offset(0, 1).Value
.Send 'Or use Display
End With
Set olMail = Nothing
End If
End If
Next cell
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub

Problem is that for each sending of e-mail it is necessary confirmation

and
I have to press button "YES".
How I can avoid pressing on "YES" and to send everything automatically.

Best wishes,
Lado









  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default email to each person with attachment

Thank you Ron,

I did already and it works but I don't know person who will use this program
want's to install "express clickYES" program. I will try to find out with
him.

Thank you for your help,
Lado

"Ron de Bruin" wrote in message
...
Read good!!

For Outlook see this webpage
http://www.dimastr.com/redemption/
OR Express ClickYes
http://www.express-soft.com/mailmate/clickyes.html


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Kiknadze Lado" wrote in message

...
Thank you for your answer.
I'm using MS Outlook and I couldn't find how to uncheck this option.

Best,
Lado

"Ron de Bruin" wrote in message
...
See this part of my site
http://www.rondebruin.nl/sendmail.htm#Prevent

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Kiknadze Lado" wrote in message

...
Dear all,

I have excel spreadsheet:
In column A the names of the people
In column B the e-mail Addresses
In column C the Filenames like this C:\Data\Book2.xls This don't

have
to be
Excel files.

I have the Macro wich loop through each row in Sheet1 and if there

is a
E-mail address
and a filename that exist in that row it will create a mail with

this
information and send it.

Sub TestFile()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim cell As Range
Application.ScreenUpdating = False
Set olApp = New Outlook.Application
For Each cell In

Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants)
If cell.Offset(0, 1).Value < "" Then
If cell.Value Like "*@*" And Dir(cell.Offset(0,

1).Value) <
""
Then
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = cell.Value
.Subject = "Testfile"
.Body = "Hi " & cell.Offset(0, -1).Value
.Attachments.Add cell.Offset(0, 1).Value
.Send 'Or use Display
End With
Set olMail = Nothing
End If
End If
Next cell
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub

Problem is that for each sending of e-mail it is necessary

confirmation
and
I have to press button "YES".
How I can avoid pressing on "YES" and to send everything

automatically.

Best wishes,
Lado











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
Sending a Spreadsheet as an Email Attachment vs. Imbedded in Email billbrandi Excel Discussion (Misc queries) 1 April 3rd 08 03:44 AM
Email Attachment Dan DeCoursey Excel Discussion (Misc queries) 2 August 7th 07 03:00 PM
How to send attachment to one person at a time w/ routing slip? LedzBlack Excel Discussion (Misc queries) 1 July 23rd 07 04:26 PM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM


All times are GMT +1. The time now is 02:47 PM.

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

About Us

"It's about Microsoft Excel"