Normal Topic WordMerge for 2.05 -- trouble with text field (Read 553 times)
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
WordMerge for 2.05 -- trouble with text field
Mar 14th, 2008 at 5:41pm
Print Post Print Post  
I've been trying to implement the new WordMerge programming found in the Feb. 08 edition of InsideSesame and everything is working pretty well, except that a large multi-line text field isn't being listed as a field that can be merged. From the InsideSesame article:

Quote:
As already noted, the other big improvement is that
WordMerge now automatically generates the list of
mergeable LE names. The external text file has been
eliminated by a subroutine that makes a list of all the
elements on the form, then weeds out the ones that can’t
contain editable data, such as static text and command
buttons. Here’s the new subroutine in full:

Code
Select All
SUBROUTINE MergeFields()
// Make a list of the LE’s that can contain editable data
var n as Int
var nn as Int
For n = 1 to @CountStringArray(vLEs)
vName = @AccessStringArray(vLEs, n)
SetThisElement(vName)
nn = @ElementType(ThisElement)
// If in following range, LE supports editable data
If nn > 999 and nn < 1009
// Add to the list of LEs exported for mailmerge
vNames = @AppendStringArray(vNames, vName)
UnSetThisElement()
Next 



The steps I took were:

1. Ran a command button containing "var vLEs as String = @StringArrayElementList()"
and found that the name of the field did in fact show up.

2. Then I checked to see the @ElementType for the field and it returned '1024' -- which would invalidate it as an editable field according to the programming. The programming manual doesn't list what a LE with a type of '1024' would be.

Also, the WordMerge programming removes @NewLine(), but my text field makes use of the command -- is there any way around that? What I have is a form for generating estimates for custom products. The field in question is called 'EstimateText' -- and hence can have several @NewLine() calls. Any suggestions?
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: WordMerge for 2.05 -- trouble with text field
Reply #1 - Mar 14th, 2008 at 6:38pm
Print Post Print Post  
1024 is the new multiline text editor widget. Add it to the conditional to include them.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: WordMerge for 2.05 -- trouble with text field
Reply #2 - Mar 14th, 2008 at 6:47pm
Print Post Print Post  
Hammer wrote on Mar 14th, 2008 at 6:38pm:
1024 is the new multiline text editor widget. Add it to the conditional to include them.


Ok, I can do that. But what about @NewLine()? The current programming replaces them with two spaces -- is there some way to insert a carriage return instead of the spaces? Or would Word still crash? As it is now, the text merges, but while viewing it in Word, the user must enter the carriage returns manually. Not tragic, but is there some way to preserve the carriage returns?
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: WordMerge for 2.05 -- trouble with text field
Reply #3 - Mar 14th, 2008 at 7:05pm
Print Post Print Post  
A newline means "new record" to Word. They cannot appear in the data to be merged. If you want, you can replace them with a different character, then use find/replace in Word to flip it back instead of doing it by hand.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged