Page 1 of 1

What component do i use to save an rtf/? wit headers/footers

Posted: Wed Jun 15, 2016 7:47 pm
by DelphiDude
into a file that can be read/edited/saved/printed in MS WORD?
TSRichView is where i am at now but i can seem to get the headers/footers to save into a file that when opened in WORD has all the info.

Posted: Thu Jun 16, 2016 8:50 am
by Sergey Tkachenko
TSRichViewEdit supports all kinds of headers that can be found in RTF file.
If it does not work for some RTF file, please send this file to me richviewgmailcom

No i have the tsrichview working like i want but

Posted: Thu Jun 16, 2016 1:50 pm
by DelphiDude
i have not been able to figure out how to save it to a file that can be opened by WORD and still have the headers/footers.
in my project the tsrichview looks perfect now i just need to save it so it can be emailed to another office/client to open in their WORD.

Posted: Thu Jun 16, 2016 4:23 pm
by Sergey Tkachenko
In ScaleRichView, headers and footers must be saved to RTF and DocX.
If it does not happen, please explain how to reproduce this problem.

Using the example program for SRichView editor..

Posted: Sat Jun 25, 2016 5:58 pm
by DelphiDude
C:\VCL\TRichViewTrialDelphi\ScaleRichView\Demos\RVDemos\Assorted\Printing\Headers

I modified the MainMenu to have a Save option and added this code to it.

Code: Select all

procedure TForm1.Save1Click(Sender: TObject);
begin
  SRichViewEdit1.RichViewEdit.SaveRTF('t:\01.rtf',False);
  SRichViewEdit1.RichViewEdit.SaveDocX('t:\01.docx',False);
end;
When i open either of those files in WORD there are no Headers. The Preview screen shows the headers.

I tried using this sample program as well but it also didn't

Posted: Sat Jun 25, 2016 6:03 pm
by DelphiDude
save with headers in the doc file.
C:\VCL\TRichViewTrialDelphi\ScaleRichView\Demos\RVDemos\OfficeConverters

When I open the rtf file the headers show but when i save it (.doc) and open in WORD, no headers.

Posted: Sat Jun 25, 2016 6:34 pm
by Sergey Tkachenko
Converters are external DLLs allowing to save and load documents in different formats. Export converters take RTF as an input, and convert this RTF to a file of certain format.
The converters may lose some data if they do not understand it. As you can see, DOC export converter loses headers and footers.

This demo loads RTF using our own methods, without using converters, so it imports all headers and footers. However, if you save a DOC file using a converter, headers and footers are lost.
Instead of using converters, save RTF or DocX file using our own methods, SaveRTF and SaveDocX.
You can use RichViewActions, and the demo from C:\VCL\TRichViewTrialDelphi\ScaleRichView\Demos\ActionTestTabs\
The "Save As" command allows saving RTF and DocX.

OK after verifying that the sample demo worked

Posted: Sat Jun 25, 2016 7:02 pm
by DelphiDude
i started comparing differences.
SRichView.RTFOptions.rvrtfSaveHeaderFooter - True

Sorry to have taken up your time on such a stupid issue.
Thank you so much.