Reputation: 4191
We need to insert a signature image into a Word template document. We are doing the mail-merging, etc. fine. But how do we insert an image programmatically? The signature image is not always the same.
We are using Delphi. But I can translate a C solution (if it does not use C libraries).
I also need to know how to position the image.
Upvotes: 0
Views: 2580
Reputation: 2320
var
Word, Doc: Variant;
begin
Word := CreateOleObject('Word.Application');
Doc := Word.Documents.Open('C:\test\word.docx');
Word.ActiveDocument.InlineShapes.AddPicture('C:\test\sign.bmp');
Doc.Save;
Word.Quit;
end;
Upvotes: 4