Hi,
I have some .DOC files that are being converted to .RTF files, using MSWord OLE instructions. Everything is ok. Then I load the .RTF files in TWPRichText to make some processing, like replacing the header with my own header, adding some content to the body, etc. Then I save the .RTF file. When I do this, it appears in the beggining of the body a word (SomeNameXX)that originally wasn't there. Looking at the RTF file I noted that this word is the \company tag, in \info section. Searching at the original .RTF file created with MSWord, the tag is a bit different, being handled as a \* tag kind. Looking at WPIOWriteRTF.pas unit, I found that besides company, also manager, category and hlinkbase are handled equally, and should has the same problem.
Original .RTF file create with MSWord:
{\info{\title }{\author Administrador}{\operator alessandrofm}{\creatim\yr2008\mo8\dy1\hr16\min16}{\revtim\yr2008\mo8\dy1\hr16\min25}{\version3}{\edmins10}{\nofpages1}{\nofwords170}{\nofchars918}{\*\company SomeNameXX}
.RTF file created with WPTools
{\info{\*\title }{\*\author Administrador}{\*\operator alessandrofm}{\company SomeNameXX}}{\*\userprops {\propname myownrtfvariable}\proptype30{\staticval 09/07/2008 16:35:26}
WPIOWriteRTF.pas code handling this tags:
if (s = 'manager') or (s = 'company') or (s = 'category') or (s = 'hlinkbase') then
s := '{\' + s + #32
else s := '{\*\' + s + #32;
WriteString(s);
Why isn't being used the \* tag there, so it should be ignored and content and handled as a simple info tag?
Oh, by the way, I cannot turn off saving RTF Variables, because I need UserProps to be saved.
Thanks for your help
Alessandro