With Delphi 7 Pro
I need to add a picture (signature) at the bottom of word documents (office 2003/2007). Documents may have one or more pages each.
I'have tried with ole:
but the picture is inserted at the beginning of the document not at the end.
I tried also with bookmarks but theese are not recognised.
I'have tried with wdGotoLine/wdGotoLast but in this case the picture is inserted at the end of the first page.
Somebody can help with this code or other one ?
Any components free/shareware/commercial ?
Thanks
Giovanni Caramia
I need to add a picture (signature) at the bottom of word documents (office 2003/2007). Documents may have one or more pages each.
I'have tried with ole:
Code:
uses
comobj;
procedure TForm1.Button1Click(Sender: TObject);
var wdgotolast,wdgotopage,wdgotoabsolute : olevariant;
begin
Word := CreateOLEObject('Word.Application');
Word.Visible := true;
Word.Documents.Open(GetCurrentDir+'\word.doc');
word.Selection.GoTo(wdGotoPage,wdGoToLast,wdgotoabsolute,EmptyParam);
word.selection.inlineshapes.addpicture('c:\firma.jpg');
.....
word.free;
end;
but the picture is inserted at the beginning of the document not at the end.
I tried also with bookmarks but theese are not recognised.
I'have tried with wdGotoLine/wdGotoLast but in this case the picture is inserted at the end of the first page.
Somebody can help with this code or other one ?
Any components free/shareware/commercial ?
Thanks
Giovanni Caramia