Stuart McLachlan
stuart at lexacorp.com.pg
Sat Apr 10 18:26:08 CDT 2010
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