Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default Export Excel Data to an Outlook Email

Sounds simple but this is proving a headache for me. I'm looking for any
smnippest of code out there that can handle the following.

In column A I have the date an email should be sent.
In Column B I have the email address to which the email is to be sent.
In Column C I have the subject of the email
In Column D I have the body of the email.
In Column E I have the name of the person sending the email.

The code I'm looking for needs to work like this.

If I click on any cell in column A (on any date), nothing must happen,
unless the date is 'today'. If the datre is today this will trigger the data
in columns b,c,d,e to be entered into an email launched from Outlook in the
roder highlighted below.

If there are any clever boffins out there please help me...

Gordon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Export Excel Data to an Outlook Email

Hi Gordon

Start here
http://www.rondebruin.nl/mail/folder3/message.htm

In the yes/no column use a formula like this
=IF(C1= TODAY(),"Yes","No")

See also tje tips
http://www.rondebruin.nl/mail/tips2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Gordon" wrote in message ...
Sounds simple but this is proving a headache for me. I'm looking for any
smnippest of code out there that can handle the following.

In column A I have the date an email should be sent.
In Column B I have the email address to which the email is to be sent.
In Column C I have the subject of the email
In Column D I have the body of the email.
In Column E I have the name of the person sending the email.

The code I'm looking for needs to work like this.

If I click on any cell in column A (on any date), nothing must happen,
unless the date is 'today'. If the datre is today this will trigger the data
in columns b,c,d,e to be entered into an email launched from Outlook in the
roder highlighted below.

If there are any clever boffins out there please help me...

Gordon



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default Export Excel Data to an Outlook Email

Thanks for that...

Have you got a working example of this code...

Gordon

"Ron de Bruin" wrote:

Hi Gordon

Start here
http://www.rondebruin.nl/mail/folder3/message.htm

In the yes/no column use a formula like this
=IF(C1= TODAY(),"Yes","No")

See also tje tips
http://www.rondebruin.nl/mail/tips2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Gordon" wrote in message ...
Sounds simple but this is proving a headache for me. I'm looking for any
smnippest of code out there that can handle the following.

In column A I have the date an email should be sent.
In Column B I have the email address to which the email is to be sent.
In Column C I have the subject of the email
In Column D I have the body of the email.
In Column E I have the name of the person sending the email.

The code I'm looking for needs to work like this.

If I click on any cell in column A (on any date), nothing must happen,
unless the date is 'today'. If the datre is today this will trigger the data
in columns b,c,d,e to be entered into an email launched from Outlook in the
roder highlighted below.

If there are any clever boffins out there please help me...

Gordon




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Export Excel Data to an Outlook Email

Hi Gordon

Try this, use display in the code to test

'In column A I have the date an email should be sent.
'In Column B I have the email address to which the email is to be sent.
'In Column C I have the subject of the email
'In Column D I have the body of the email.
'In Column E I have the name of the person sending the email.
'In column F copy down this formula
=IF(A1= TODAY(),"Yes","No")


Sub TestFile()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
On Error GoTo cleanup
For Each cell In Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants)
If cell.Value Like "*@*" And LCase(cell.Offset(0, 4).Value) = "yes" Then
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = cell.Value
.Subject = cell.Offset(0, 1).Value
.Body = cell.Offset(0, 2).Value
.Send 'Or use Display
End With
Set OutMail = Nothing
End If
Next cell
cleanup:
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Gordon" wrote in message ...
Thanks for that...

Have you got a working example of this code...

Gordon

"Ron de Bruin" wrote:

Hi Gordon

Start here
http://www.rondebruin.nl/mail/folder3/message.htm

In the yes/no column use a formula like this
=IF(C1= TODAY(),"Yes","No")

See also tje tips
http://www.rondebruin.nl/mail/tips2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Gordon" wrote in message ...
Sounds simple but this is proving a headache for me. I'm looking for any
smnippest of code out there that can handle the following.

In column A I have the date an email should be sent.
In Column B I have the email address to which the email is to be sent.
In Column C I have the subject of the email
In Column D I have the body of the email.
In Column E I have the name of the person sending the email.

The code I'm looking for needs to work like this.

If I click on any cell in column A (on any date), nothing must happen,
unless the date is 'today'. If the datre is today this will trigger the data
in columns b,c,d,e to be entered into an email launched from Outlook in the
roder highlighted below.

If there are any clever boffins out there please help me...

Gordon






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default Export Excel Data to an Outlook Email

Thanks Ron...

"Ron de Bruin" wrote:

Hi Gordon

Try this, use display in the code to test

'In column A I have the date an email should be sent.
'In Column B I have the email address to which the email is to be sent.
'In Column C I have the subject of the email
'In Column D I have the body of the email.
'In Column E I have the name of the person sending the email.
'In column F copy down this formula
=IF(A1= TODAY(),"Yes","No")


Sub TestFile()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
On Error GoTo cleanup
For Each cell In Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants)
If cell.Value Like "*@*" And LCase(cell.Offset(0, 4).Value) = "yes" Then
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = cell.Value
.Subject = cell.Offset(0, 1).Value
.Body = cell.Offset(0, 2).Value
.Send 'Or use Display
End With
Set OutMail = Nothing
End If
Next cell
cleanup:
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Gordon" wrote in message ...
Thanks for that...

Have you got a working example of this code...

Gordon

"Ron de Bruin" wrote:

Hi Gordon

Start here
http://www.rondebruin.nl/mail/folder3/message.htm

In the yes/no column use a formula like this
=IF(C1= TODAY(),"Yes","No")

See also tje tips
http://www.rondebruin.nl/mail/tips2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Gordon" wrote in message ...
Sounds simple but this is proving a headache for me. I'm looking for any
smnippest of code out there that can handle the following.

In column A I have the date an email should be sent.
In Column B I have the email address to which the email is to be sent.
In Column C I have the subject of the email
In Column D I have the body of the email.
In Column E I have the name of the person sending the email.

The code I'm looking for needs to work like this.

If I click on any cell in column A (on any date), nothing must happen,
unless the date is 'today'. If the datre is today this will trigger the data
in columns b,c,d,e to be entered into an email launched from Outlook in the
roder highlighted below.

If there are any clever boffins out there please help me...

Gordon






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
can I use data from Excel to export fields into Outlook? Sharla Excel Discussion (Misc queries) 1 December 19th 08 04:53 PM
How do I export email addresses from Excel to Outlook? JasonLi Excel Discussion (Misc queries) 2 May 22nd 06 03:51 PM
How do i export excel data to outlook contacts Joshna Excel Discussion (Misc queries) 1 July 13th 05 03:01 PM
How do I export data from Excel to Outlook Skylarnyc Excel Discussion (Misc queries) 2 February 7th 05 07:43 PM
How do I export email addresses from excel to outlook? Mark Davies Excel Discussion (Misc queries) 1 February 2nd 05 01:21 PM


All times are GMT +1. The time now is 01:37 AM.

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"