i would like to change the font in my word doc for some parts of my doc.
But don't know how too, any help is appriciated
A help file would be nice too since i'm new to OLE automation, any
suggestions where to find it???
tnx Rim
Alternatively you will probably need to go to the Microsoft website and
search there.
Rim Ranshuijsen <ri...@hotmail.com> wrote in message
news:3c77d478_1@dnews...
To get started, have a look at
http://www.djpate.freeserve.co.uk/Automation.htm
Here is an example showing how to change the font for
different paragraphs and sentences in a document. (Word is
a TWordApplication component, Doc is a TWordDocument.)
var
WFont: _Font;
R: Range;
begin
Doc.ConnectTo(Word.ActiveDocument as _Document);
R := Doc.Paragraphs.First.Range;
R.InsertAfter('Blue is beautiful, blue is best. ');
R.InsertParagraphAfter;
R.InsertAfter('I am blue, I am beautiful, I am best!');
R.InsertParagraphAfter;
R.InsertAfter('The blue cat. ');
R.InsertParagraphAfter;
WFont := Doc.Paragraphs.First.Range.Font;
WFont.Name := 'Arial';
WFont.Color := clRed;
WFont.Size := 14;
WFont := Doc.Paragraphs.Item(2).Range.Font;
WFont.Name := 'Times';
WFont.Color := clBlue;
WFont.Size := 16;
WFont := Doc.Sentences.Item(3).Font;
WFont.Name := 'Georgia';
WFont.Italic := integer(msoTrue);
--
Deborah Pate (TeamB) http://delphi-jedi.org
TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html