Board index » delphi » Help with headers/footers Please ?
Marcus Reisinger
![]() Delphi Developer |
Fri, 09 Jan 2004 17:22:20 GMT
|
Marcus Reisinger
![]() Delphi Developer |
Fri, 09 Jan 2004 17:22:20 GMT
Help with headers/footers Please ?My problem is that I need to insert the contents of a richtextbox in Delphi into an open Word document (.rtf), which works fine except that when using "rtfbox.Lines.savetoFile();" Thanks P.S.: |
Ahma
![]() Delphi Developer |
Fri, 09 Jan 2004 19:05:00 GMT
Re:Help with headers/footers Please ?QuoteMarcus Reisinger <marcus.reisin...@noevers.at> wrote in message Quote
using "rtfbox.Lines.savetoFile();" Quote> overwrites the comlete content of my document destroying all previously thing seems to happen when I open Quote> the document in Word and paste the content of the richtextbox into the off using that so the current page format should not change. The only thing you need to do is placing the cursor in the right location and insert the object (in your case file). regards, |
Team
![]() Delphi Developer |
Fri, 09 Jan 2004 19:45:04 GMT
Re:Help with headers/footers Please ?<<Marcus Reisinger: "rtfbox.Lines.savetoFile();" overwrites the comlete content of my document Quotewhy you're doing that - perhaps if you post more code I'll see the light. :) Here are a couple of ways to access a header or footer), <<Marcus: Quoteselection pasted to. So to stop your work being overwritten, you have to make sure it isn't included in the range, by using the Range.Collapse method first. Direction := wdCollapseEnd; <<Marcus: Quote(ack!). :) -- Use Borland servers; TeamB don't see posts via ISPs |
Marcus Reisinge
![]() Delphi Developer |
Fri, 09 Jan 2004 20:41:01 GMT
Re:Help with headers/footers Please ?"Deborah Pate (TeamB)" <d.p...@cableinet.co.not-this-bit.uk> wrote: Quote><<Marcus Reisinger: responders! Second, I did this for reasons of speed, cause it's always very much faster to replace variables or parts of the text inside the Delphi program instead of passing each change over to Word. Besides, my users wish to have an extremely fast preview of the document without starting Word. Here's the code: //Replaces text inside a richtextbox function FFreplaceVars(varname,vartext,ctrltype: String): Boolean; Var selstart,sellen: Integer; FindTxt: String; begin //Spezialit?t fr Inkassobriefe If (varname = 'i.V. Reitermayer e.h./') Then Findtxt := varname Else Findtxt := '?' + varname + '?'; vartext := replaceNewlines(vartext); sellen := Length(brieffrm.fastviewmemo.Text); selstart := brieffrm.fastviewmemo.FindText(Findtxt,0,sellen,[]); While (selstart <> - 1) do begin brieffrm.fastviewmemo.SelStart := selstart; If (ctrltype = 'CHECK') and (vartext = '') Then brieffrm.fastviewmemo.SelLength := Length(Findtxt) + 1 Else brieffrm.fastviewmemo.SelLength := Length(Findtxt); brieffrm.fastviewmemo.SelText := vartext; FFReplacevars := True; sellen := Length(brieffrm.fastviewmemo.Text); //wenn i.V. ersetzt wurde mu? selstart -1 gesetzt werden, sonst Endlosschleife If (Findtxt <> 'i.V. Reitermayer e.h./') Then selstart := brieffrm.fastviewmemo.FindText(Findtxt,0,sellen,[]) else selstart := - 1; end; end; Quote>Here are a couple of ways to access a header or footer), |
1. Help! Headers and Footers in Report Smith
2. Freezing header and footer on screen
3. Problems with header and footer
4. ReportSmith Black Blocked Headers and Footers
5. QuckReport Group Header & Footer
6. Generating custom headers/footers with ReportSmith
7. grid type component that allows group headers/footers
8. Problems with header and footer
9. Problems with headers and footers
10. Setting Page header/footer and margins from printing html page