#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default Email

I'm using Ron de Bruin's email code to send my active workbook. I'd like to
be able to send a document saved to my desktop along with this code. Can
anyone tell me what I need to add?

Ron's code:

Sub Mail_workbook_1()
'Working in 97-2007
Dim wb As Workbook
Set wb = ActiveWorkbook

If Val(Application.Version) = 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will" &
vbNewLine & _
"be no VBA code in the file you send. Save the" &
vbNewLine & _
"file first as xlsm and then try the macro again.",
vbInformation
Exit Sub
End If
End If

On Error Resume Next
wb.SendMail ", _
"This is the Subject line"
On Error GoTo 0
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Email

Not Possible with SendMail

See the Outlook object model examples on my mail page if you use Outlook
http://www.rondebruin.nl/sendmail.htm


--

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


"chrisnsmith" wrote in message ...
I'm using Ron de Bruin's email code to send my active workbook. I'd like to
be able to send a document saved to my desktop along with this code. Can
anyone tell me what I need to add?

Ron's code:

Sub Mail_workbook_1()
'Working in 97-2007
Dim wb As Workbook
Set wb = ActiveWorkbook

If Val(Application.Version) = 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will" &
vbNewLine & _
"be no VBA code in the file you send. Save the" &
vbNewLine & _
"file first as xlsm and then try the macro again.",
vbInformation
Exit Sub
End If
End If

On Error Resume Next
wb.SendMail ", _
"This is the Subject line"
On Error GoTo 0
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default Email

I should have mentioned that both workbooks are open at the time I want to
email.
I discovered that if I just reference the workbook name I can send as many
workbooks as I wish with your code as long as they are all open.
Thanks




--

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


"chrisnsmith" wrote in message ...
I'm using Ron de Bruin's email code to send my active workbook. I'd like to
be able to send a document saved to my desktop along with this code. Can
anyone tell me what I need to add?

Ron's code:

Sub Mail_workbook_1()
'Working in 97-2007
Dim wb As Workbook
Set wb = ActiveWorkbook

If Val(Application.Version) = 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will" &
vbNewLine & _
"be no VBA code in the file you send. Save the" &
vbNewLine & _
"file first as xlsm and then try the macro again.",
vbInformation
Exit Sub
End If
End If

On Error Resume Next
wb.SendMail ", _
"This is the Subject line"
On Error GoTo 0
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Email

Hi chrisnsmith

If you use the Outlook object model code on my site you can send
any file you want but this is not possible with SendMail.
The files not have to be open


--

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


"chrisnsmith" wrote in message ...
I should have mentioned that both workbooks are open at the time I want to
email.
I discovered that if I just reference the workbook name I can send as many
workbooks as I wish with your code as long as they are all open.
Thanks




--

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


"chrisnsmith" wrote in message ...
I'm using Ron de Bruin's email code to send my active workbook. I'd like to
be able to send a document saved to my desktop along with this code. Can
anyone tell me what I need to add?

Ron's code:

Sub Mail_workbook_1()
'Working in 97-2007
Dim wb As Workbook
Set wb = ActiveWorkbook

If Val(Application.Version) = 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will" &
vbNewLine & _
"be no VBA code in the file you send. Save the" &
vbNewLine & _
"file first as xlsm and then try the macro again.",
vbInformation
Exit Sub
End If
End If

On Error Resume Next
wb.SendMail ", _
"This is the Subject line"
On Error GoTo 0
End Sub



  #5   Report Post  
Posted to microsoft.public.excel.misc
Dar Dar is offline
external usenet poster
 
Posts: 25
Default Ron de Bruin: Please


I'm hoping you're still active, and would like to incorporate your code but
using Lotus Notes instead of outlook. I need to know how to modify code.
"Ron de Bruin" wrote:

Hi chrisnsmith

If you use the Outlook object model code on my site you can send
any file you want but this is not possible with SendMail.
The files not have to be open


--

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


"chrisnsmith" wrote in message ...
I should have mentioned that both workbooks are open at the time I want to
email.
I discovered that if I just reference the workbook name I can send as many
workbooks as I wish with your code as long as they are all open.
Thanks




--

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


"chrisnsmith" wrote in message ...
I'm using Ron de Bruin's email code to send my active workbook. I'd like to
be able to send a document saved to my desktop along with this code. Can
anyone tell me what I need to add?

Ron's code:

Sub Mail_workbook_1()
'Working in 97-2007
Dim wb As Workbook
Set wb = ActiveWorkbook

If Val(Application.Version) = 12 Then
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, there will" &
vbNewLine & _
"be no VBA code in the file you send. Save the" &
vbNewLine & _
"file first as xlsm and then try the macro again.",
vbInformation
Exit Sub
End If
End If

On Error Resume Next
wb.SendMail ", _
"This is the Subject line"
On Error GoTo 0
End Sub




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
send email to each customer email in excel sheet. -keevill- Excel Discussion (Misc queries) 3 July 17th 08 02:33 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
can I copy a column of email addresses, paste into email address? Lizizfree New Users to Excel 4 July 20th 06 10:03 PM
Transfer Email addresses from spreadsheet to email address book Beana Excel Discussion (Misc queries) 2 May 30th 06 06:07 PM
Email editor closes when forwarding Excel-embedded email Bambina Setting up and Configuration of Excel 0 March 16th 06 10:45 PM


All times are GMT +1. The time now is 05:31 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"