hi paul, thanks for replying. I've been finding an active delphi forum for few days now!
first of all..yes im using late binding, and i've tried various ways even those found from google groups but nothing can seem to work or fully compatible with what im doing.
By the way, i'm trying to get these working, it kept saying incompatible types between listtemplate, listlevel against variant types. Is there any way to get it working? because i'd like to see the output of this code!
procedure TForm3.Button1Click(Sender: TObject);
var
vListTemplate: ListTemplate;
vLevel: OleVariant;
OutlineNum: OleVariant;
Level: ListLevel;
ContinuePrev: OleVariant;
var
wrdApp, wrdDoc, wrdSelect : OleVariant;
begin
// Create an instance of Word and make it visible
wrdApp := CreateOleObject('Word.Application');
wrdApp.Visible := True;
// Create a new document
wrdDoc := wrdApp.Documents.Add();
wrdSelect := wrdApp.Selection;
//
wrdSelect.TypeText('(i) phase 1' + chr(13));
wrdSelect.TypeText(' - description, description, description.' + chr(13));
wrdSelect.TypeText(' - description, description, description,');
wrdSelect.TypeText('description, description, description.' + chr(13));
wrdSelect.TypeText('(ii) phase 2' + chr(13));
wrdSelect.TypeText(' - description, description, description,');
wrdSelect.TypeText('description, description, description,');
wrdSelect.TypeText('description, description, description.' + chr(13));
//
wrdDoc.Application.ActiveDocument.Select;
OutLineNum := True;
vListTemplate := wrdDoc.ListTemplates.Add(OutLineNum, EmptyParam);
Level := vListTemplate.ListLevels.Item(1);
Level.NumberFormat := '?'; //ChrW(61607);
Level.TrailingCharacter := wdTrailingTab;
Level.NumberStyle := wdListNumberStyleBullet;
Level.Alignment := wdListLevelAlignLeft;
Level.Font.Bold := wdUndefined;
Level.Font.Italic := wdUndefined;
Level.Font.StrikeThrough := wdUndefined;
Level.Font.Subscript := wdUndefined;
Level.Font.Superscript := wdUndefined;
Level.Font.Shadow := wdUndefined;
Level.Font.Outline := wdUndefined;
Level.Font.Emboss := wdUndefined;
Level.Font.Engrave := wdUndefined;
Level.Font.AllCaps := wdUndefined;
Level.Font.Hidden := wdUndefined;
Level.Font.Underline := wdUndefined;
Level.Font.ColorIndex := wdUndefined;
Level.Font.Size := 10;
Level.Font.Animation := wdUndefined;
Level.Font.DoubleStrikeThrough := wdUndefined;
Level.Font.Name := 'Wingdings';
Level.LinkedStyle := '';
ContinuePrev := False;
wrdDoc.Range.ListFormat.ApplyListTemplate(vListTemplate,
ContinuePrev, EmptyParam); //wdListApplyToWholeList);
end;