![]() |
Loop Attachment (once again)
Hello people,
Here is a question: I need a macro that will be able to create a new message and add an attachment per each new message and loop through a folder. The reason for that is attachments should be of specific size not less or more of 500 KB each and therefore I can't add all of them into one email. And there will about 50 messages, maybe more later. It will be continuing (at least it looks like so for now). Anyone can help me with it? Thanks in advance Dan PS: At least, if you know any recommendations of where I can find similar written code. |
Loop Attachment (once again)
What version of Outlook. This is supposed to run as an Outlook VBA macro?
What do you mean by "loop through a folder"? What kind of folder, loop and do what? I don't know what 50 messages has to do with it, what is different about each of those 50 messages? How do you want the code to handle those 50 messages, is it different for each one? How? Is this macro supposed to run on demand or automatically? There are lots of Outlook code samples at www.outlookcode.com, but no one can be much more specific until you clearly explain what you need and what you want to accomplish. That's most likely why no one has been answering your posts, the requirements aren't clearly explained. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Dan" wrote in message ... Hello people, Here is a question: I need a macro that will be able to create a new message and add an attachment per each new message and loop through a folder. The reason for that is attachments should be of specific size not less or more of 500 KB each and therefore I can't add all of them into one email. And there will about 50 messages, maybe more later. It will be continuing (at least it looks like so for now). Anyone can help me with it? Thanks in advance Dan PS: At least, if you know any recommendations of where I can find similar written code. |
Loop Attachment (once again)
Hi Ken,
Sorry about the confusion - I am using MS Outlook 2007. The issue about the folder and 50 messages, I need to send some files to friend of mine which is about 50 MB but provider doesn't let emails through that have attachments that are more 500 KB, therefore I had split them. Now I have 100 files and I will have to create an email for each file. Like 1st email and attache 1st file, and then create 2nd email and attach 2nd file and so one until I am done attaching all 100 files (that is why I called it loop - do until finish all files in a folder). It is a bit tiresome and that is the reason I had asked for help! Do you think there is anything available at Outlook Programming-VBA community? With best regards Dan |
Loop Attachment (once again)
I don't think there's anything specific for something like that, if it was
me and I didn't own a Web site I'd just use one of those public sites where you can post files for FTP downloads, or something like that. I'd also be looking for a different ISP, that limitation is absurd. You can use something like FileSystemObject to get at the folder and all files in it. Then loop and iterate each file and add it as an attachment to a mail item. Something like this I suppose, which would require a VBA project reference for the MS Scripting Runtime (scrrun.dll): Dim FSO As Scripting.FileSystemObject Dim tFile As Scripting.File Dim oFolder As Scripting.Folder Dim sPath As String Dim sTemp As String Set FSO = CreateObject("Scripting.FileSystemObject") sPath = "C:\" Set oFolder = FSO.GetFolder(sPath) For Each tFile In oFolder.Files sTemp = sPath & tFile.name Set oMail = Application.CreateItem(olMailItem) oMail.Subject = "More files" Set oRecip = ") oRecip.Resolve oMail.Attachments.Add(sTemp) oMail.Send Next -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Dan" wrote in message ... Hi Ken, Sorry about the confusion - I am using MS Outlook 2007. The issue about the folder and 50 messages, I need to send some files to friend of mine which is about 50 MB but provider doesn't let emails through that have attachments that are more 500 KB, therefore I had split them. Now I have 100 files and I will have to create an email for each file. Like 1st email and attache 1st file, and then create 2nd email and attach 2nd file and so one until I am done attaching all 100 files (that is why I called it loop - do until finish all files in a folder). It is a bit tiresome and that is the reason I had asked for help! Do you think there is anything available at Outlook Programming-VBA community? With best regards Dan |
Loop Attachment (once again)
Thanks again, Ken! It worked just perfect. Unfortunately changing ISP would
not help, as the attachment size limitation issue is not in US, the ISP is in Central Asia, the recipient's provider. And there are not many providers available either in there. And FTP public sites are not available either. Anyway, thanks again. All the best Dan. |
signature & picture
Not familar with outlook VBA have used excel & word. Would like to build a
macro that will insert a signature & a picture on one stroke. I use a two step method now only on forward or reply messages. If i create a new message it will not allow me to insert signature & picture. Useing 2000 & xp Any code I can work with will be appreciated. Thanks "Ken Slovak - [MVP - Outlook]" wrote: I don't think there's anything specific for something like that, if it was me and I didn't own a Web site I'd just use one of those public sites where you can post files for FTP downloads, or something like that. I'd also be looking for a different ISP, that limitation is absurd. You can use something like FileSystemObject to get at the folder and all files in it. Then loop and iterate each file and add it as an attachment to a mail item. Something like this I suppose, which would require a VBA project reference for the MS Scripting Runtime (scrrun.dll): Dim FSO As Scripting.FileSystemObject Dim tFile As Scripting.File Dim oFolder As Scripting.Folder Dim sPath As String Dim sTemp As String Set FSO = CreateObject("Scripting.FileSystemObject") sPath = "C:\" Set oFolder = FSO.GetFolder(sPath) For Each tFile In oFolder.Files sTemp = sPath & tFile.name Set oMail = Application.CreateItem(olMailItem) oMail.Subject = "More files" Set oRecip = ") oRecip.Resolve oMail.Attachments.Add(sTemp) oMail.Send Next -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Dan" wrote in message ... Hi Ken, Sorry about the confusion - I am using MS Outlook 2007. The issue about the folder and 50 messages, I need to send some files to friend of mine which is about 50 MB but provider doesn't let emails through that have attachments that are more 500 KB, therefore I had split them. Now I have 100 files and I will have to create an email for each file. Like 1st email and attache 1st file, and then create 2nd email and attach 2nd file and so one until I am done attaching all 100 files (that is why I called it loop - do until finish all files in a folder). It is a bit tiresome and that is the reason I had asked for help! Do you think there is anything available at Outlook Programming-VBA community? With best regards Dan |
signature & picture
You need to read any replies to you posts and not just keep posting the same
things. This thread you latched onto has nothing at all to do with your question, which was already answered in one of your original threads. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Curt" wrote in message ... Not familar with outlook VBA have used excel & word. Would like to build a macro that will insert a signature & a picture on one stroke. I use a two step method now only on forward or reply messages. If i create a new message it will not allow me to insert signature & picture. Useing 2000 & xp Any code I can work with will be appreciated. Thanks "Ken Slovak - [MVP - Outlook]" wrote: I don't think there's anything specific for something like that, if it was me and I didn't own a Web site I'd just use one of those public sites where you can post files for FTP downloads, or something like that. I'd also be looking for a different ISP, that limitation is absurd. You can use something like FileSystemObject to get at the folder and all files in it. Then loop and iterate each file and add it as an attachment to a mail item. Something like this I suppose, which would require a VBA project reference for the MS Scripting Runtime (scrrun.dll): Dim FSO As Scripting.FileSystemObject Dim tFile As Scripting.File Dim oFolder As Scripting.Folder Dim sPath As String Dim sTemp As String Set FSO = CreateObject("Scripting.FileSystemObject") sPath = "C:\" Set oFolder = FSO.GetFolder(sPath) For Each tFile In oFolder.Files sTemp = sPath & tFile.name Set oMail = Application.CreateItem(olMailItem) oMail.Subject = "More files" Set oRecip = ") oRecip.Resolve oMail.Attachments.Add(sTemp) oMail.Send Next -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Dan" wrote in message ... Hi Ken, Sorry about the confusion - I am using MS Outlook 2007. The issue about the folder and 50 messages, I need to send some files to friend of mine which is about 50 MB but provider doesn't let emails through that have attachments that are more 500 KB, therefore I had split them. Now I have 100 files and I will have to create an email for each file. Like 1st email and attache 1st file, and then create 2nd email and attach 2nd file and so one until I am done attaching all 100 files (that is why I called it loop - do until finish all files in a folder). It is a bit tiresome and that is the reason I had asked for help! Do you think there is anything available at Outlook Programming-VBA community? With best regards Dan |
All times are GMT +1. The time now is 05:56 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com