Login | |
|
 |
RE: Problem sending e-mail from script - 3/27/2007 6:55:59 PM
|
|
 |
|
| |
markmcrobie
Posts: 314
Score: 0
Joined: 12/12/2006
Status: offline
|
Ok, I sussed out how to call the Sub, was pretty easy. So now I have code that says: intSize = objFolder2.Size If intSize < 5000000 Then SendAttach Where objFolder2 is the folder where the renamed files are, and SendAttach is the name of my Sub. My sub looks like: Sub SendAttach() Dim objOutlook Dim objMail Dim strMsg Const olMailItem = 0 Set objOutlook = CreateObject("Outlook.Application") Set objMail = objOutlook.CreateItem(olMailItem) objMail.To = "mark.mcrobie@amec.com" objMail.Subject = "Transfer to Navynet" For Each strAttach In arrFiles objMail.Attachments.Add objPath & "\" & strAttach Next objMail.Body = "The attached files are to be placed onto the Navynet PC" objMail.Display 'Use objMail.Display to display before sending, otherwise call objMail.Send to send without reviewing Set objMail = Nothing Set objOutlook = Nothing End Sub My problem now, in case you haven't spotted it, is my size comparison compares the total size of the files in the folder against 5MB, but my Sub only attaches the files who's names are in the array. This means that if I run the script and it renames, say, 2 files at 100Kb each, but there's already, say, 6MB of files in the folder, then the Sub won't be called and these 2 won't be sent. What I really need to do is compare the size of the files who's names are in the array against 5MB, and if it's less then call the Sub. But I'm guessing I can't just get the size of the files from the looking at the size of the array, since it's the actual file size I need and the array basically just holds the name?
|
|
| |
|
|
|
 |
RE: Problem sending e-mail from script - 4/2/2007 1:29:56 PM
|
|
 |
|
| |
dm_4ever
Posts: 2396
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
Hi FBSmith, Could you please create a new post for this so that others can provide assistance and not confuse this with the original?
< Message edited by dm_4ever -- 4/2/2007 2:05:10 PM >
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|