Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

Change font in word document or where to find a helpfile

5 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Rim Ranshuijsen

ungelesen,
23.02.2002, 12:41:5023.02.02
an
Hi there,

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


Sarah Lander

ungelesen,
25.02.2002, 03:45:3225.02.02
an
Within Microsoft Office 97 you need to do a custom install of Microsoft Word
and check the box for Visual Basic help as this is not installed by default
when you install Microsoft Word. This will give you access to the VBA help
files which contain some information on the Word Automation Object. I am
assuming a similar principle will apply for later versions of Microsoft
Word.

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...

Deborah Pate (TeamB)

ungelesen,
25.02.2002, 07:30:2125.02.02
an
<<Rim Ranshuijsen:

i would like to change the font in my word doc for some
parts of my doc.
>>

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


0 neue Nachrichten