Word:Selection.HeaderFooter.Shapes-cannot select the shape
here is my code for pasting a bitmap into the header then selecting and
resizing it:
var t:tbitmap;
AFormat: Word;
AData: THandle;
APalette: HPALETTE;
begin
t:=tbitmap.create;
t.assign(modcenik.tnastavitve.fieldbyname('Logo'));
t.SaveToClipboardFormat(aformat,adata,apalette);
clipBoard.SetAsHandle(aformat,AData);
w.ActiveWindow.ActivePane.View.Type:=$00000003;// wdPageView, postavitev
strani
w.ActiveWindow.ActivePane.View.SeekView:=$00000009;//
wdSeekCurrentPageHeader
w.selection.paste;
t.free;
w.ActiveDocument.Shapes[0].Select; //error
w.selection.ShapeRange.ScaleWidth(0.35,false,);
w.selection.ShapeRange.ScaleHeight(0.35,false,);
w.ActiveWindow.ActivePane.View.SeekView:=$00000000;// wdSeekMainDocument
end;
when I try to select it it displays:item is not a property.
I've tried the following: shapes[0].select, shapes.item[0].select,
shapes('Picture 1').select
and none works (seems that shapes is not a property nor a method?).
What to do?
Thanks,
Marko.