Jump to content
Server Maintenance This Week. ×

MergeFields1 ( text ; openBrac ; openBrac )


This topic is 6568 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Name & Parameters: [color:red][big] MergeFields1 ( text ; openBrac ; openBrac ) [/big]

Description: This Custom Function works together with MergeFields2 to enable you to take Merge Fields from a text field and fill in with data from fields. (i.e. "Dear <>, etc."). Once they are installed, use MergeFields1 in your calculations and ignore MergeFields2.

Note: "openBrac" and "closeBrac" allow you to use whatever kind of bracketing characters you wish to delineate the merge fields. I have used "<>" but you might want to use square brackets or some other character.

Note2: I made a mistake when I first put this up. The parameter, "table", was a leftover from an earlier version. I have corrected the error. Sorry.

YOU MUST INSTALL BOTH MergeFields1 AND MergeFields2

Sample Input:

<>

<

Dear <>,

Thanks for your note.

Sincerely,

Jake Sterling

Results:

Ms. Rebecca Stone

23 Isleboro Way

Stonington, Maine 03482

Dear Rebecca,

Thanks for your note.

Sincerely,

Jake Sterling

Recursive: yes

Formula:

MergeFields2 ( text ; openBrac ; closeBrac ; 1 ) & 



//GET LAST MERGE FIELD



GetField (  



Middle ( text ; 

Position (text ; openBrac ; 1 ; PatternCount ( text ; openBrac ) ) + Length ( openBrac );  

Position ( text ; closeBrac ; 1 ; PatternCount ( text ; closeBrac ) ) -  Position (text ; openBrac ; 1 ; PatternCount ( text ; closeBrac ) ) - Length ( openBrac ))) 



//End GetField

 & 



//GET LAST TEXT



Middle ( 



text ; 



Position ( text ; closeBrac ; 1 ; PatternCount ( text ; closeBrac ) ) + Length ( closeBrac ) ;



Length ( text) - Position ( text ; closeBrac ; 1 ; PatternCount ( text ; closeBrac ) ) ) 

Required Functions: MergeFields2

Author(s): Jake Sterling

Date: 05/03/06

Credits:

Disclaimer:

FM Forums does not endorse or warrantee these files are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify.

Edited by Guest
Link to comment
Share on other sites

This topic is 6568 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.