HI ALL , I HAVE AN APPLICATION THAT NEEDS TO DO SOME STRINGS REPLACES IN HEADER AND FOOTER, BUT MY CODE BELOW JUST CHANGE TEXT IN PRINCIPAL RANGE ( BODY ) AND NOT IN HEADER AND FOOTER.

IīM USING DELPHI7 AND THE TWORDAPPLICATION COMPONENT IN SERVERS PALETE

I CONT YOU TO HELP ME SOLVE THIS PROBLEM

THANKS


CODE :

// PUT THIS CODE IN A BUTTOM DO OPEN WORD DOCUMENT

var
FileName : OleVariant ;

begin

try

FileName := 'c:\teste.doc' ;

MyWordApplication.Documents.Open(
FileName , EmptyParam , EmptyParam , EmptyParam ,
EmptyParam , EmptyParam , EmptyParam , EmptyParam ,
EmptyParam , EmptyParam , EmptyParam , EmptyParam ) ;

MyWordApplication.Visible := True ;

MyWordApplication.ShowMe ;

end;


// PUT THIS CODE IN A BUTTOM TO REPLACE STRING IN DOCUMENT

var

Find_Text : OleVariant ;
ReplaceWith : OleVariant ;
Param_Replace : OleVariant ;

begin

Find_Text := 'TESTE' ;
ReplaceWith := 'TESTANDO' ;
Param_Replace := wdReplaceAll ;

MyWordApplication.ActiveDocument.Content.Find.Exec ute(
Find_Text ,
EmptyParam ,
EmptyParam ,
EmptyParam ,
EmptyParam ,
EmptyParam ,
EmptyParam ,
EmptyParam ,
EmptyParam ,
ReplaceWith ,
Param_Replace ,
EmptyParam ,
EmptyParam ,
EmptyParam ,
EmptyParam ) ;

MyWordApplication.ScreenRefresh ;

end;