急!急!急!控制word中图片的大小的问题!(100分)

  • 主题发起人 主题发起人 limingxi007
  • 开始时间 开始时间
L

limingxi007

Unregistered / Unconfirmed
GUEST, unregistred user!
在拷贝图片到word中,我想用程序来控制他的大小,不知各位有什么好的方法!
 
我也遇到该问题,请高手发表建议 !
 
index:OleVariant;

index:=i;
//调整位置
WordDocument1.Shapes.Item(Index).IncrementLeft(256);
WordDocument1.Shapes.Item(Index).IncrementTop(80);
//调整大小
WordDocument1.Shapes.Item(Index).width:=300;
WordDocument1.Shapes.Item(Index).height:=200;
 
Wordhandle:=CreateOLEObject('Word.Application');
Wordhandle.Documents.open('d:/jingdianpic.doc',true);
wordhandle.visible:=true;
wordhandle.Selection.Find.ClearFormatting;
wordhandle.Selection.Find.Replacement.ClearFormatting;
////////////////////
wordhandle.selection.inlineshapes.addpicture(filename:=edit1.Text);
wordhandle.selection.typebackspace;
wordhandle.selection.inlineshapes.height:=283.3;//这句出现错误,说inlineshapes不是方法

wordhandle.selection.inlineshapes.width:=377.85;
我用宏命令的转换来调整图片的大小,但是在上面我画横线的那句出现错误,不知道为什么,请高手赐教!!
 
inlineshapes是不可移动的也是不可以改变大小的吧
用shape
 
你先开启WORD,开始录制宏,放置一张图片,调整该图片的大小,停止录制宏,看看宏代码,然后转换成DELPHI中的语句。用这种方法试一试。
 
后退
顶部