BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Word2000 new page

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Boris Pertsov
Guest





PostPosted: Wed Jan 28, 2004 12:12 pm    Post subject: Word2000 new page Reply with quote



Hi!
I need to open new page in the word2000 in runtime and to insert text
inside.
How ? (Example).
Please !!!


Back to top
Wayne Herbert
Guest





PostPosted: Wed Jan 28, 2004 3:55 pm    Post subject: Re: Word2000 new page Reply with quote



uses
comobj, Word2000;
var
Word : OLEVariant;
PageHeight, PageWidth : single;

Word := CreateOleObject('Word.Application');
Word.Visible := True; // Show Word
Word.Documents.Add; // Add a new Document
// if not a single view window then make it that way
if Word.ActiveWindow.View.SplitSpecial <> wdPaneNone then
Word.ActiveWindow.Panes[2].Close;
Word.ActiveWindow.View.Type := wdPrintView; // view allows accessing
headers
Word.ActiveWindow.ActivePane.View.Zoom.Percentage := 100;
Word.ActiveWindow.ActivePane.View.SeekView := wdSeekMainDocument; // set
for main document
// set the page size
Word.ActiveDocument.PageSetup.PageHeight := PageHeight; // points
Word.ActiveDocument.PageSetup.PageWidth := PageWidth;
// write out a line of text
Word.Selection.TypeText(Text := 'This is a line of text');
// advance to the next line
Word.Selection.TypeParagraph;


I've got a program that uses odd and even headers, watermarks, and special
fields in the headers. Email me if you want it.

Boris Pertsov wrote:

Quote:
Hi!
I need to open new page in the word2000 in runtime and to insert text
inside.
How ? (Example).
Please !!!


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.