Well...that's not really what I said;
I posted the code for Sub FindReplace(... )
This Sub treats the rtf as Word object (NOT as text file!) and replaces field codes as follows:
-deactivate field codes
-replace the searched string (i.e.: a field code name)
-activate your field codes again
then I think you have problems in viewing replaced field code names due to their lenght, when lenght exceeds the cell lenght of your table you cant see them.
This is because field codes cant be viewed on more lines, even if you put a newline inside it.
So you should replace a field code with a normal text string, in this way your text can be viewed on more lines.
To do this I suggested to use Sub FindReplace(... ) adding the line:
Sfind = "^dMACROBUT TON QueryVeld " & Sfind
Just after opening your rtf file as Word object (NOT as text file!).
Then even if you use:
Sreplace = "pippopippopipp opippopippopipp opippopippopipp opippopippopipp opippopippopipp opippo"
Your field code name (still passed through Sfind as parameter) will be replaced with the text string Sreplace, which, being normal text, can be displayed on more lines.
You can also pass Sreplace as a string comin from a text file, this shouldn't be a problem.
diSangro
I posted the code for Sub FindReplace(... )
This Sub treats the rtf as Word object (NOT as text file!) and replaces field codes as follows:
-deactivate field codes
-replace the searched string (i.e.: a field code name)
-activate your field codes again
then I think you have problems in viewing replaced field code names due to their lenght, when lenght exceeds the cell lenght of your table you cant see them.
This is because field codes cant be viewed on more lines, even if you put a newline inside it.
So you should replace a field code with a normal text string, in this way your text can be viewed on more lines.
To do this I suggested to use Sub FindReplace(... ) adding the line:
Sfind = "^dMACROBUT TON QueryVeld " & Sfind
Just after opening your rtf file as Word object (NOT as text file!).
Then even if you use:
Sreplace = "pippopippopipp opippopippopipp opippopippopipp opippopippopipp opippopippopipp opippo"
Your field code name (still passed through Sfind as parameter) will be replaced with the text string Sreplace, which, being normal text, can be displayed on more lines.
You can also pass Sreplace as a string comin from a text file, this shouldn't be a problem.
diSangro
Originally posted by amitp
Comment