Cardbox > Forums > Macros and Programming > "Attaching Documents to Bulk Email"
Attaching Documents to Bulk Email
I need to be able to attach a document to a bulk email from cardbox. |
Posted By | Post |
---|---|
Voices4Wellbeing | 3-Aug-2011 09:56 Hi, I have read the help files and tried to do this myself with no joy. Does anyone have a simple macro that will allow me to choose an attachment when I send a bulk email? I would be extremely grateful. Steven |
bert | 3-Aug-2011 11:20 Hi, Please record a macro with all settings YOU use (test it on one record with an email address to yourself). I will look to insert a command for a dialog choosing an attachment (all users same attachment?). regards |
Voices4Wellbeing | 3-Aug-2011 13:04 Hi bert, Thank you for that. After discussions with a colleague, I think it would be easier to use a macro that just inserts the email address from a field into the 'to' box of an Outlook message. Is this possible? |
Voices4Wellbeing | 3-Aug-2011 13:49 Please ignore the last message, this does not work because of issues with maximum recipicents. I am using the macro below. I get a box to choose a document to attach, and then get the error: "Command Failed. Cannot find the specified file (80070002). Error in Line 11, character 2)" which is the beginning of the attach file command of this macro: ' For ways in which you can modify this macro, SendEmail20110803_3287c99 Records,RecordPosition,Records.Count ' Send email (automatically generated) Sub SendEmail20110803_3287c99(recs,first,last) ' (automatically generated command) Dim i,rec,text |
Voices4Wellbeing | 3-Aug-2011 14:03 Sorry to bombard you. I have changed the macro so that I specify the specific files to attach within the macro, and that works. But it is a very messy way of sending a bulk email, because I would have to edit the macro everytime to change the body of the text and attached files (made especially painstaking with the way I seem to have to use "& vbCrLf & vbCrLf &" to donate a new line. What I basically want to be able to do is use the bulk mail feature (because it knows the limit of email addresses per message and works around this automatically), but for it to open up outlook with all the email address in the bcc field so I can them compose my message and send it as normal. Is this possible? P.S: I also want to change the horrible font that it seems to send these emails in. |
bert | 3-Aug-2011 14:29 For good understanding let me turn it around: 1. You want compose a email in Outlook If this is all: If you want to personalise email then a more complex macro is needed to generate the individual emails. I found a workaround for also sending the email in Outlook (not only composing) by the macro without the annoying Outlook security messages. Bulk email in Cardbox is only generating txt email. It is not possible to generate HTML email which gives a lot of layout possibilities. One of my future wishes for Cardbox is that a format with merge blocks and images etc could be used as source for generating simple HTML email. This cannot be very complicated difficult to add (some things are already present link end of line translation to <br>). Regards |
Voices4Wellbeing | 3-Aug-2011 14:34 Yes, you have it right. I do not need to generate individual emails. My only issue with doing it via outlook is that I have a limit of 40 recipicents, otherwise I get an error. From reading the help, I know I can tell the Bulk Email tool to send it in batches of 40. If I just copy and paste email addresses, I will lose that function. I need a way of sending from outlook, but taking advantage of the recipicent number tool. Without having to split my email addressed manually into blocks of 40. |
bert | 3-Aug-2011 19:35 Several solutions are possible. |
Voices4Wellbeing | 4-Aug-2011 08:09 Wow, thanks for that. I like option number 2. That sounds like the easiest way to do this. Just to make it more difficult, I have 6 different fields for email addresses per record (for different contacts per organisation). Is it possible to: 1) Include these fields in the macro to search and copy to clipboard. For example, one record may only have an email address is on of the boxes, whilst another might have all 6. If it just copied the first 40 fields, I may only end up with 7 or 8 email addressses. Does that make sense? |
bert | 4-Aug-2011 09:12 Try this macro. It generates an email in Outlook with max 39 addreses into your bcc field. The macro: 'number of max addresses in bcc 'you can also pickup this here from a txt file. Do not forget that a vbcrlf or lf must be translated to <br> 'the subject of your mail set em = Records 'make an array of x 'generate a email after 39 addresses 'the last addresses '=================================================== ps: |
bert | 4-Aug-2011 09:15 if i39 = 39 then should be if i39 = maxmail then regards |
Voices4Wellbeing | 4-Aug-2011 09:39 Bert, you are an absolute legend. That is working perfectly, and does exactly what I needed it to do. Thank you so much for your help, I really do appreciate it. This bulk email stuff has been an issue for me and for my equivilent in our sister office for a long time now. Thank you again. |
Voices4Wellbeing | 10-Aug-2011 10:34 Hi bert, I am going to be greedy and ask for more help with refining this. Is it possible for the macro to ask for one (or possibly multiple) attachments before generating the emails so that every email is created with attachments already on? |
Voices4Wellbeing | 10-Aug-2011 10:35 I have tried with the "sender.AttachFile("c:\path\filename.typ")" I found in the help file, but I cannot get it to work. |
bert | 10-Aug-2011 15:44 Hi, |
Voices4Wellbeing | 11-Aug-2011 13:04 It will be the same files for every recipient, but sometimes it may be 1 file, othertimes it may be multiple files. I was also wondering if it would be possible to edit the body text of the email address before generating the email, but using HTML so I can change the font to Arial and type the email out once rather than copying and pasting into multiple emails. I basically want to type the email in Arial font, choose attachments (could be 0, could be quite a few), and then have it generate the emails. |
bert | 20-Aug-2011 13:00 Well, Before dlg = GetOpenFilenames("All Files|*.*","","select files (use > 1 ctrl+click!)",cbxGetFilenamesWithPanel) then before .Display add this for add the files: for each fle in fles and it will work. regards |
Voices4Wellbeing | 22-Aug-2011 08:47 Thank you Bert, that is working excellently. To be extra cheeky, is there anyway I can format the text of the email so that I can change the font of the body text to arial? |
Voices4Wellbeing | 22-Aug-2011 09:04 And how would I then format the body text to include line breaks, bold, website links etc? I don't suppose there is any way of bringing up a "What You See Is What You Get" formatting box to edit the body text is there? |
bert | 22-Aug-2011 09:34 I suggest var emtxt fill with content of a html file (standard name). |
Voices4Wellbeing | 22-Aug-2011 09:34 Looking back up this thread, the option 4 you mentioned seems like it may be ideal. You wrote: "My last bulk email I did I developed it did all with a Cardbox/smtp macro. Does this mean I could then format the email with line breaks/bold text/web links etc without writing it in HTML and have it place it in the emails generated by my macro? |