B
bz
I am using Word 2000 and XP.
I have a table containing formfields. In a macro I output the contents of
selected formfields to a text file and then later insert this file into a new
Word document and use the text to table conversion to create a table.
Sometimes, if one of the formfields contains carriage returns, the result is
that the text following the carriage return begins on the first column of the
next row (i.e. not the next line in the same cell).
The best solution would be to have the carriage returns work correctly
(within the same cell).
An alternative is to strip out the carriage returns. I tried doing this
using the Replace function. Before writing out to the text file, I copy the
..result of the formfield to a string
(myString=ActiveDocument.FormFields("myString").Result).
I then try to replace: myString=Replace(myString,"^p",""). Also tried with
myString=Replace(myString,Chr(13),"").
The result is that no replacement is made. This is the case no matter what
I try to use as a replacement string.
Thanks in advance for any help, bz
I have a table containing formfields. In a macro I output the contents of
selected formfields to a text file and then later insert this file into a new
Word document and use the text to table conversion to create a table.
Sometimes, if one of the formfields contains carriage returns, the result is
that the text following the carriage return begins on the first column of the
next row (i.e. not the next line in the same cell).
The best solution would be to have the carriage returns work correctly
(within the same cell).
An alternative is to strip out the carriage returns. I tried doing this
using the Replace function. Before writing out to the text file, I copy the
..result of the formfield to a string
(myString=ActiveDocument.FormFields("myString").Result).
I then try to replace: myString=Replace(myString,"^p",""). Also tried with
myString=Replace(myString,Chr(13),"").
The result is that no replacement is made. This is the case no matter what
I try to use as a replacement string.
Thanks in advance for any help, bz