Board index » delphi » Normal text after table appears in table but I want it to be normal WORD

Normal text after table appears in table but I want it to be normal WORD

Hi, I have created a table in Word and am outputting data to it.
After the table I want to put a note (outside and below the table), however
it keeps appearing in the table.
Could someone please point out what I'm missing?  (See after //End While)

  Row := 2;//Fisrt row after Titles
  while not qryAny.eof do begin
     with qryAny do begin
     u := u + IntToStr(FieldByName('ORDERNO').AsInteger) + ',';
     file://Make All Strings Fixed Length for Column Neatness
     T.Cell(Row, 1).Range.Text:= IntToStr(FieldByName('ORDERNO').AsInteger);
     T.Cell(Row, 2).Range.Text:= FieldByName('RM').AsString;
     T.Cell(Row, 3).Range.Text:= FieldByName('BELMAY_REF').AsString;
     T.Cell(Row, 4).Range.Text:= FormatFloat('0.00',
fieldByName('OLDPRICEPERKG').AsFloat);
     T.Cell(Row, 5).Range.Text:= FormatFloat('0.00',
fieldByName('NEWPRICEPERKG').AsFloat);
     T.Cell(Row, 6).Range.Text :=
DateToStr(FieldByName('DATEIN').AsDateTime);
     end;//with
     Inc(Row);
     qryAny.Next;
  end;//while

  S.TypeParagraph;  S.TypeParagraph;
  S.ParagraphFormat.Alignment := wdAlignParagraphCenter;

  S.Font.Italic := Integer(true);
  S.TypeText ('The order(s) listed are for items brought with a price
increase of more than 10% over the previous purchase price.');
  S.TypeText('  These orders have either been delivered 2 weeks ago (with
the stock at that time > 0, or have been delivered more recently when the
existing stock was 0.');
  S.TypeParagraph;    S.TypeParagraph;
  S.Font.Bold := Integer(True);
  S.TypeText('Re-costing of any products containing these raw materials may
need to be considered!');
  S.Font.Italic := Integer(False);

--
Many Thanks -
Please CC Responses To :-

Antho...@Belmay.Co.UK

 

Re:Normal text after table appears in table but I want it to be normal WORD


Sussed it -
var w : OleVariant

  w := wdStory;
  S.EndKey(w,EmptyParam);

Quote
Ant D'Cruze wrote in message <96b3um$t4...@bornews.inprise.com>...
>Hi, I have created a table in Word and am outputting data to it.
>After the table I want to put a note (outside and below the table), however
>it keeps appearing in the table.
>Could someone please point out what I'm missing?  (See after file://End
While)

>  Row := 2;//Fisrt row after Titles
>  while not qryAny.eof do begin
>     with qryAny do begin
>     u := u + IntToStr(FieldByName('ORDERNO').AsInteger) + ',';
>     file://Make All Strings Fixed Length for Column Neatness
>     T.Cell(Row, 1).Range.Text:=

IntToStr(FieldByName('ORDERNO').AsInteger);
Quote
>     T.Cell(Row, 2).Range.Text:= FieldByName('RM').AsString;
>     T.Cell(Row, 3).Range.Text:= FieldByName('BELMAY_REF').AsString;
>     T.Cell(Row, 4).Range.Text:= FormatFloat('0.00',
>fieldByName('OLDPRICEPERKG').AsFloat);
>     T.Cell(Row, 5).Range.Text:= FormatFloat('0.00',
>fieldByName('NEWPRICEPERKG').AsFloat);
>     T.Cell(Row, 6).Range.Text :=
>DateToStr(FieldByName('DATEIN').AsDateTime);
>     end;//with
>     Inc(Row);
>     qryAny.Next;
>  end;//while

>  S.TypeParagraph;  S.TypeParagraph;
>  S.ParagraphFormat.Alignment := wdAlignParagraphCenter;

>  S.Font.Italic := Integer(true);
>  S.TypeText ('The order(s) listed are for items brought with a price
>increase of more than 10% over the previous purchase price.');
>  S.TypeText('  These orders have either been delivered 2 weeks ago (with
>the stock at that time > 0, or have been delivered more recently when the
>existing stock was 0.');
>  S.TypeParagraph;    S.TypeParagraph;
>  S.Font.Bold := Integer(True);
>  S.TypeText('Re-costing of any products containing these raw materials may
>need to be considered!');
>  S.Font.Italic := Integer(False);

>--
>Many Thanks -
>Please CC Responses To :-

>Antho...@Belmay.Co.UK

Re:Normal text after table appears in table but I want it to be normal WORD


I think the solution is, to position the cursor. Adding text occurs at the position of the cursor. Try to move the cursor at the end of the table and then insert the text.

Quote
"Ant D'Cruze" <antho...@belmay.co.uk> wrote:
>Hi, I have created a table in Word and am outputting data to it.
>After the table I want to put a note (outside and below the table), however
>it keeps appearing in the table.
>Could someone please point out what I'm missing?  (See after //End While)

>  Row := 2;//Fisrt row after Titles
>  while not qryAny.eof do begin
>     with qryAny do begin
>     u := u + IntToStr(FieldByName('ORDERNO').AsInteger) + ',';
>     file://Make All Strings Fixed Length for Column Neatness
>     T.Cell(Row, 1).Range.Text:= IntToStr(FieldByName('ORDERNO').AsInteger);
>     T.Cell(Row, 2).Range.Text:= FieldByName('RM').AsString;
>     T.Cell(Row, 3).Range.Text:= FieldByName('BELMAY_REF').AsString;
>     T.Cell(Row, 4).Range.Text:= FormatFloat('0.00',
>fieldByName('OLDPRICEPERKG').AsFloat);
>     T.Cell(Row, 5).Range.Text:= FormatFloat('0.00',
>fieldByName('NEWPRICEPERKG').AsFloat);
>     T.Cell(Row, 6).Range.Text :=
>DateToStr(FieldByName('DATEIN').AsDateTime);
>     end;//with
>     Inc(Row);
>     qryAny.Next;
>  end;//while

>  S.TypeParagraph;  S.TypeParagraph;
>  S.ParagraphFormat.Alignment := wdAlignParagraphCenter;

>  S.Font.Italic := Integer(true);
>  S.TypeText ('The order(s) listed are for items brought with a price
>increase of more than 10% over the previous purchase price.');
>  S.TypeText('  These orders have either been delivered 2 weeks ago (with
>the stock at that time > 0, or have been delivered more recently when the
>existing stock was 0.');
>  S.TypeParagraph;    S.TypeParagraph;
>  S.Font.Bold := Integer(True);
>  S.TypeText('Re-costing of any products containing these raw materials may
>need to be considered!');
>  S.Font.Italic := Integer(False);

>--
>Many Thanks -
>Please CC Responses To :-

>Antho...@Belmay.Co.UK

Other Threads