Compatible with old Delphi!
 
Ultimate Pack

Set page break in Word document - Others - Tips & Tricks - Greatis Delphi Pages

This example shows, how to create new Word document with two pages. Don't forget to add ComObj in uses chapter.

uses ComObj;
...
procedure TForm1.Button1Click(Sender: TObject);
var
  Word: OleVariant;
  PageBreak: Integer;
begin
  Word:=CreateOleObject('Word.Application');
  Word.WordBasic.FileNew;
  Word.WordBasic.Insert('page1');
  PageBreak:=1;
  Word.Selection.InsertBreak(PageBreak);
  Word.WordBasic.Insert('page2');
  Word.Visible:=True;
end;
Related topics
Work with word document

For more
Win32 Programmer's reference

Download source


Delphi books recommended by Amazon.com

More Delphi programming books on Amazon.com


Copyright © 1998-2013 Greatis Software