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

General TRichView support forum. Please post your questions here
Post Reply
DelphiDude
Posts: 17
Joined: Sun Mar 27, 2016 5:15 pm

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

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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
DelphiDude
Posts: 17
Joined: Sun Mar 27, 2016 5:15 pm

No i have the tsrichview working like i want but

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
DelphiDude
Posts: 17
Joined: Sun Mar 27, 2016 5:15 pm

Using the example program for SRichView editor..

Post 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.
DelphiDude
Posts: 17
Joined: Sun Mar 27, 2016 5:15 pm

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

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
DelphiDude
Posts: 17
Joined: Sun Mar 27, 2016 5:15 pm

OK after verifying that the sample demo worked

Post 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.
Post Reply