WPCubed Product Support

COMPANY tag wrongly handled

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

#1 ♥ 0
3.9k Views 2 users read 2 min
support

Hi,

which version of Word ?

It has a reason the company is not handled with the \\ - it was not imported otherwise in the older Word versions. If Word now produces \\ consequently than its no problem to add this.

Julian

#2 ♥ 0

Hi Julian,

I'm currently using MSWord 2003. Should I just remove that code and add \* as the tag instead, in the Writer?

Alessandro

#3 ♥ 0
support

Hi,

well, the code is easy to find:

if (s = 'manager') or (s = 'company') or (s = 'category') or (s = 'hlinkbase') then
              s := '{\' + s + #32
            else

this cause disbles the \* for the mentioned tags on purpose.

Regards,

Julian

#4 ♥ 0

Hi Julian,

Yes, it's exactly there that I was talking. My question was about 'possible colateral effects on that'.

Thanks

Alessandro

#5 ♥ 0
This category is archived. No new posts are possible.