Board index » delphi » set cell's font properties of Excel Ole Automation

set cell's font properties of Excel Ole Automation

I am new for Excel Ole Automation.

I want to know how to set a cell's font properties,
e.g. font name, font size, font style and font color

Would you help me ?

Lonnie

 

Re:set cell's font properties of Excel Ole Automation


<<Lonnie:
I want to know how to set a cell's font properties,
e.g. font name, font size, font style and font color

Quote

If WS is your worksheet:
var
  F: Excel2000.Font; // or Excel97.Font;
..
  F := WS.Range['A1', 'A1'].Font;
  F.Size := 22;
  F.Name := 'Times New Roman';
  F.FontStyle := 'Bold';

--
Deborah Pate (TeamB) http://delphi-jedi.org

  Use Borland servers; TeamB don't see posts via ISPs
  http://www.borland.com/newsgroups/genl_faqs.html

Other Threads