On 04/02/2006, at 10:13 PM, Carl Vanderpal wrote:

Just wondering if there is a better way of doing this..

I have a site that that customizes documents with about 5-10 (could expand later on) elements that customizable - the example I can think of is a mail merge.

I say this as end users are entering the data and I want to make it easy for them to utilize customizable fields..

~FirstName~ (replace with) SESSION[User].FirstName
~LastName~ (replace with) SESSION[User].LastName

~City~ (replace with) SESSION[User].City
~Country~ (replace with) SESSION[User].Country

RE Subexpressions are your friend (Assume you then save this as a .cfm then include it):

<cfsavecontent variable="x">
~FirstName~ (replace with) SESSION[User].FirstName
~LastName~ (replace with) SESSION[User].LastName

~City~ (replace with) SESSION[User].City
~Country~ (replace with) SESSION[User].Country
</cfsavecontent>

<cfoutput><pre>#REReplace(x, "~([^~]+)~", "##SESSION[User].\1##", "ALL")#</pre></cfoutput>

______________

Robin Hilliard
Director - RocketBoots Pty Ltd
Professional Services for Macromedia Technologies
http://www.rocketboots.com.au

For schedule/availability call Pamela Higgins:
w    +61 7 5451 0362
m    +61 419 677 151
e    [EMAIL PROTECTED]

or Direct:
m    +61 418 414 341
f    +61 2 9798 0070
e    [EMAIL PROTECTED]

 *** Register for WebDU http://www.mxdu.com 2-3 March 2006 ***




Reply via email to