I developed a form previewer in clarion which shows a form or displays a form in a small window before opening it into MS Word
My concern is once i load the .RTF Document it starts popping up the error as shown in the screenshot, and this happens only for few documents and not all,
I found a solution on the internet but was only able to get few pieces of information,
Is this a word issue for RTF File or do i need to do anything?
I found this solution and itâs working as expected, but still document loading takes almost 15/20 secs, is their any workaround or is it a MS Word issue?
I developed a form previewer in clarion which shows a form or displays a form in a small window before opening it into MS Word
My concern is once i load the .RTF Document it starts popping up the error as shown in the screenshot, and this happens only for few documents and not all,
I found a solution on the internet but was only able to get few pieces of information,
Is this a word issue for RTF File or do i need to do anything?
I donât understand why you are starting a new thread. This is likely to get deleted as a duplicate of:
(I think this may have already happened once before)
If you have more information to add, please add it to that earlier thread to keep all the information together in the one place.
If the earlier method using Wordpad is not practical due to a large number of documents then I suggest you do it on a few files and compare the before and after rtf files. You can then see what the differences are and perhaps write some code to automatically do those changes. Remember rtf files are just text files and can be manipulated by your code (did I mention StringTheory?). Just a thought.
This is allocated dynamically, though only large documents are having issues while viewing, word is inserting some blank spaces or characters due to which loading is being slow.
it is hard to know when you didnât say whether you had any success with my earlier suggestion:
if it is still not working, maybe attach a few RTF files before/after the Wordpad fix and show your code to do the desired transformation - assuming you could readily see the differences and were able to have a go at doing the fix programatically.
Assumption: You are able to fix the rtfâs using Wordpad but you want to do it in Clarion code instead. Is that correct?
I thought you could fix the problems manually by pasting into WordPad and saving but there were too many of the forms so you wanted a fix in code. But now I read there are only one or two files/forms with the problems and for some reason WordPad is not solving the problem.
Perhaps if you can zip up the forms that are failing and post them if they are not too large then I (or someone else) can look and see if we can spot the problem. Also include a screen shot of the exact error message for each form as the Read Aborted message seemed to have some location information (the first field was âpos:â). Perhaps there are some invalid characters that you need to remove?
Yes, do you have any idea about any tools or the piece of code which eliminated some extra spaces or words and then assembles the files after removing all the garbage characters,
Yes there are only a few forms that are lengthy and/or inserts some whitespaces into Word file, but long story short, most of the lengthy RTF files take much time and then throws POS error.
Thanks for all the help vitesse, i hope you understood my query now, waiting for your kind response
The best tool that I know of (and which I always give a free plug to) is StringTheory. I am biased but I think it is the perfect tool for slicing and dicing strings. Clarion comes with SystemString but I do not think it is as good and I am not as familiar with it.
for example to remove extra spaces look at Squeeze with the ST:NOPUNCTUATION option.
and to remove âgarbage charactersâ perhaps you could use either KeepChars or RemoveChars.
Perhaps you have UTF8 chars in there and need to do st.toAnsi(st:EncodeUtf8).
Or perhaps there are other characters (or combination of characters) that you need to do replacements on in which case you would use st.ReplaceâŚ
For example a while ago someone on the newsgroups was having a problem with three âgarbage charactersâ and in that case having seen his data I suggested:
if ~st.loadFile('.\testdata\Test.in')
message('Failed to load file' &'||Error: '& st.LastError ,'File not Loaded')
else
st.replace('<0E2h,080h,099h>','''') ! single quote
st.replace('<0E2h,080h,09Dh>','"') ! double quotes
st.replace('<0C2h,0B0h>','<0F8h>') ! degrees
st.saveFile('.\testdata\test.out')
end
This is all just general guidance as it is hard to know without seeing your RTF documents, but I hope that helps.