Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default how to send mail with excel vba

here is my sub ,

why .FoundFiles(i) are not objects,
------------------------
Sub Macro06()

Set fs = Application.FileSearch
With fs
.LookIn = "D:\temp\1Box-H22m-L4165m"
.Filename = "*.lzh"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
.FoundFiles(i).sendmail Recipients:="jyou"
Next i
Else
MsgBox "there is no files found"
End If
End With
Path
End Sub
----------------------------

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default how to send mail with excel vba

With SendMail it is only possible to send a open workbook and not other files.
Try to use the Outlook object model.

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

Maybe you can use this
http://www.rondebruin.nl/mail/folder2/files.htm

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


"EXCEL$B!!(BNEWS" wrote in message ...
here is my sub ,

why .FoundFiles(i) are not objects,
------------------------
Sub Macro06()

Set fs = Application.FileSearch
With fs
.LookIn = "D:\temp\1Box-H22m-L4165m"
.Filename = "*.lzh"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
.FoundFiles(i).sendmail Recipients:="jyou"
Next i
Else
MsgBox "there is no files found"
End If
End With
Path
End Sub
----------------------------

thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default how to send mail with excel vba

Thanks for your advice.
i would like to have a try

"Ron de Bruin" wrote in message
...
With SendMail it is only possible to send a open workbook and not other

files.
Try to use the Outlook object model.

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

Maybe you can use this
http://www.rondebruin.nl/mail/folder2/files.htm

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


"EXCEL$B!!(BNEWS" wrote in message

...
here is my sub ,

why .FoundFiles(i) are not objects,
------------------------
Sub Macro06()

Set fs = Application.FileSearch
With fs
.LookIn = "D:\temp\1Box-H22m-L4165m"
.Filename = "*.lzh"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
.FoundFiles(i).sendmail Recipients:="jyou"
Next i
Else
MsgBox "there is no files found"
End If
End With
Path
End Sub
----------------------------

thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default how to send mail with excel vba

thanks,
but how to use outlookexpress,

addin what,
thanks

"Ron de Bruin" wrote in message
...
With SendMail it is only possible to send a open workbook and not other

files.
Try to use the Outlook object model.

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

Maybe you can use this
http://www.rondebruin.nl/mail/folder2/files.htm

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


"EXCEL$B!!(BNEWS" wrote in message

...
here is my sub ,

why .FoundFiles(i) are not objects,
------------------------
Sub Macro06()

Set fs = Application.FileSearch
With fs
.LookIn = "D:\temp\1Box-H22m-L4165m"
.Filename = "*.lzh"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
.FoundFiles(i).sendmail Recipients:="jyou"
Next i
Else
MsgBox "there is no files found"
End If
End With
Path
End Sub
----------------------------

thanks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default how to send mail with excel vba

Hi EXCEL NEWS

Your only option is to the CDO code on my site if you not want to use Outlook
http://www.rondebruin.nl/cdo.htm


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


"EXCEL$B!!(BNEWS" wrote in message ...
thanks,
but how to use outlookexpress,

addin what,
thanks

"Ron de Bruin" wrote in message
...
With SendMail it is only possible to send a open workbook and not other

files.
Try to use the Outlook object model.

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

Maybe you can use this
http://www.rondebruin.nl/mail/folder2/files.htm

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


"EXCEL$B!!(BNEWS" wrote in message

...
here is my sub ,

why .FoundFiles(i) are not objects,
------------------------
Sub Macro06()

Set fs = Application.FileSearch
With fs
.LookIn = "D:\temp\1Box-H22m-L4165m"
.Filename = "*.lzh"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
.FoundFiles(i).sendmail Recipients:="jyou"
Next i
Else
MsgBox "there is no files found"
End If
End With
Path
End Sub
----------------------------

thanks








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
Is their any way to set Excel to send an e-mail on date Leger Claude Comeau Excel Discussion (Misc queries) 1 May 14th 07 01:29 AM
Send mail from Excel Steve C.[_3_] Excel Programming 3 August 21st 04 03:26 AM
Not using send button on excel e-mail Richard Excel Programming 3 April 2nd 04 05:14 PM
how to send e-mail from excel Barmaley Excel Programming 3 August 22nd 03 04:26 PM


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