Robert
robert at servicexp.com
Mon Apr 12 06:22:08 CDT 2010
Hello Stuart, Kinda, I have all the framework for the e-mail portion. The function needs to copy in the entire template and then scan the line for the placeholders. There could be multiple of the same placeholders (Customer formatting choice). EXAMPLE: (All lines would be copied in) Example Start ******************START PO ORDER ******************* Order Being Placed By: [CompanyName] [CompanyAddress] [CompanyPhone] [CompanyAccount] Order Being Place with: [VendorName] [VendorAddress] [VendorPhone] [RepName] This order's PO NUMBER: Qty ID-Number Description Cost? In-Stock? Order Shipping Costs:? Please return e-mail receipt with associated Cost and In-Stock status. ******************END PO ORDER ******************* Example End -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Saturday, April 10, 2010 7:26 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] E-Mail Format Template Function Do you mean something like this (aircode - will need debugging!): ? Dim rs as DAO.Recordset Dim strText as String Dim strMessage as String 'Get Template Open "template.txt" for binary as #1 strText = space$(Lof(1)) Get #1, strText Close #1 'Get VendorDetails and send email Set rs = currentdb.openrecordset("qryVendorDetailsForEmail") While not rs.eof strMessage = Replace(strText,"[VendorName]",rs!VendorName) strMessage = Replace(strStrMessage,"[VendorAddress]",rs!VendorAddress) Docmd.SendObject,,,rs!VendorEmail,,,"This Months News From ACME",strMessage,False Wend rs.Close Set rs = Nothing. On 10 Apr 2010 at 12:45, Robert wrote: > Goal: Send E-Mail based on a user adjustable field placement .txt template > Example: (variable place holders) > > [VendorName] > [VendorAddress] > > User can move field anywhere in the .txt document and I would place the > information in the variables... > > What's Needed: An already made function / class that will consume the text > document, allowing me to place the correct information in the correct place > holder. I don't want to recreate the wheel if it's already "out there" and > someone is willing to share it with me... > > Thanks! > > WBR > Robert > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com