I've got a dataport in order to export contact information. One of the export fields are a text field witch a length of 250
I put the complete contact information in this field, formatted by the FormatAddr.ContactAddr - Funktion.
No, I want to separate each element (name, address, city and so on) by a new line in order to put this field in a word mergefile as an addressblock. The address should be there in the right form.
I'm not able to use Interaction templates.
Is anybody here who can help me?
Many thanks
Roger
Many thanks, Roger
0
Comments
With this you can write line by line and they are automatically with CR/LF
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
But my problem is, that I have one line for each contact witch several export fields like amounts, description and so on.
And the last field for a line is the contact information which is written in one field (text 250)
I want to format the last field like this
"name <newline> address <newline> city" and so on.
Later, if the export file is merged by word, my textfield should be showed in word like this:
name
address
city
The new line after a complete line works well
Try this
// CR and LF are of type character
CR := 13;
LF := 10;
element := contact.name + Format(CR) + Format(LF)
Regards
Thomas
Now you want also to use it internally in a field, so you will have something like:
amount ; some other amount ; description ; yet another amount ; name <CRLF> adress <CRLF> <CRLF(created by the dataport because next record starts after this)>
amount ; some other amount ; description ; yet another amount ; name <CRLF> adress <CRLF> <CRLF(created by the dataport because next record starts after this)>
and so on.
So the output will be (seen by Notepad)
amount ; some other amount ; description ; yet another amount ; name
adress
amount ; some other amount ; description ; yet another amount ; name
adress
and so on.
I think this creates some confusion for mailmerge.
So I still think that the best method is still writing a file with the FILE-type, and this is what you get:
amount
some other amount
description
yet another amount
name
adress
amount
some other amount
description
yet another amount
name
adress
and so on.
Can't you put the address-fields together for merging?
or you can check if merging uses a special character (Navision uses for exemple the backslash (=\) ) that it interpretes for a CRLF. In this case you can use that character in your big address-string.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Thank you for your help.
But I tried this before I have posted my problme in forum.
Word is not able to process an ascii-file with this characters in a datafield
It seems, there is no way to handle it.
So, I have decided to use different fields, that works properly
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Path := 'C:\';
Filename := 'test.txt'
When I try to concatenate'em I get:
C:
test.txt
instead of C:\test.txt
What I want is to avoid the "new line" meaning of the \ character.
For example
OnPreDataport()
CurrDataport.FILENAME('C:\'+YourFileName+'.txt.');
Variable name is YourFileName type TEXT size 30
That's if you don't want it set in stone.
----
Also as I re-read this post - I am wondering..
Are just simply trying to create a file that word can use to create merged documents?
http://www.BiloBeauty.com
http://www.autismspeaks.org
If you do a MESSAGE('%1',Path + Filename); you will see "C:\test.txt".
So the filename will be correct.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!