Vale, me respondo a mí mismo
Estaba copiando de un "Jpg" y por eso no sacaba nada en el BitMap, la solución consistía en operar sobre
Picture.Graphic y no sobre
Picture.BitMap como estaba haciendo.
Dejo la función modificada por si le sirve a alguien
Código Delphi
[-]
Procedure TWordObj.PasteImgToBookMarks( Marca, FileImg:string;
iHeight:integer=100;
iWidth:integer=50 );
var
Image : TImage;
BitMap : TBitMap;
Area : TRect;
AFormat : Word;
AData : THandle;
APalette: HPALETTE;
EscalaX : Double;
EscalaY : Double;
Escala : Double;
Begin
if WordApp.ActiveDocument.Bookmarks.Exists(Marca) then begin
Imagen := TImage.Create( Application.MainForm );
try
with Imagen do begin
Autosize := true;
Visible := false;
Picture.LoadFromFile( FileImg );
if( Width < iWidth )
then EscalaX := Width / iWidth
else EscalaX := iWidth / Width;
if( Height < iHeight )
then EscalaY := Height / iHeight
else EscalaY := iHeight / Height;
if( EscalaY < EscalaX )
then Escala := EscalaY
else Escala := EscalaX;
with Area do begin
Bottom := Trunc(Height * Escala);
Left := 0;
Right := Trunc(Width * Escala);
Top := 0;
end;
end;
BitMap := TBitMap.Create;
with BitMap do begin
try
Height := Area.Bottom;
Width := Area.Right;
Canvas.StretchDraw(Area, Imagen.Picture.Graphic);
SaveToClipboardFormat(AFormat, AData, APalette);
finally
free;
end;
end;
finally
Imagen.Free;
end;
end;
ClipBoard.SetAsHandle(AFormat, AData);
WordApp.ActiveDocument.Bookmarks.Item(Marca).Range.Paste;
end;
SAludos
Salvador