L
linsb
Unregistered / Unconfirmed
GUEST, unregistred user!
试试:
procedure GotoPageNumber(WrdApp: TWordApplication;PageNumber:OleVariant);
var
what,which,Count:OleVariant;
begin
what:=wdGoToPage;
which:=wdGoToNext;
Count:=WrdApp.Selection.Information[wdNumberOfPagesInDocument];
WrdApp.Selection.GoTo_(what,which,Count,PageNumber);
end;
var
count,cnlevariant;
.....
Left:=20;
top:=20;
Width:=565;
height:=80;
Count:=wordapplication1.Selection.Information[wdNumberOfPagesInDocument];
for i:=1 to count do
WordApplication1.ActiveDocument.Shapes.AddPicture( 'E:/temp/b' + IntToStr(I) + '.bmp',EmptyParam, EmptyParam, Left, Top, Width, Height,EmptyParam);
n:=WordApplication1.ActiveDocument.Shapes.Get_Count;
for i:=1 to n do begin
cn:=i;
count:=1;
WordApplication1.ActiveDocument.Shapes.Item(count).Select(cn);
WordApplication1.Selection.cut;
GotoPageNumber(WordApplication1,i);
WordApplication1.Selection.Paste;
end;
procedure GotoPageNumber(WrdApp: TWordApplication;PageNumber:OleVariant);
var
what,which,Count:OleVariant;
begin
what:=wdGoToPage;
which:=wdGoToNext;
Count:=WrdApp.Selection.Information[wdNumberOfPagesInDocument];
WrdApp.Selection.GoTo_(what,which,Count,PageNumber);
end;
var
count,cnlevariant;
.....
Left:=20;
top:=20;
Width:=565;
height:=80;
Count:=wordapplication1.Selection.Information[wdNumberOfPagesInDocument];
for i:=1 to count do
WordApplication1.ActiveDocument.Shapes.AddPicture( 'E:/temp/b' + IntToStr(I) + '.bmp',EmptyParam, EmptyParam, Left, Top, Width, Height,EmptyParam);
n:=WordApplication1.ActiveDocument.Shapes.Get_Count;
for i:=1 to n do begin
cn:=i;
count:=1;
WordApplication1.ActiveDocument.Shapes.Item(count).Select(cn);
WordApplication1.Selection.cut;
GotoPageNumber(WordApplication1,i);
WordApplication1.Selection.Paste;
end;