友
友美子
Unregistered / Unconfirmed
GUEST, unregistred user!
以下代码可以在word中插入图片并设置图片大小,但是我后面输入的文字信息全部放在了前面插入的图片前面了,
=================================
使用TWordApplication控件,假设对象是WordApplication1,且已启动了Word
先声明变量
var
vSaveWithDocument: OleVariant;
vEmpty: OleVariant;
vStart: OleVariant;
vRange: OleVariant;
theInlineShape : InlineShape;
WordApplication1.Connect;
vEmpty := EmptyParam;
vSaveWithDocument := True;
vStart := WordApplication1.Selection.Start;
vRange := WordApplication1.ActiveDocument.Range(vStart, vStart);
theInlineShape := WordApplication1.ActiveDocument.inlineshapes.addpicture(edit1.Text, vEmpty,
vSaveWithDocument, vRange);//此句插入图片
WordApplication1.selection.typebackspace;//此句是为了将插入的图片选中
theInlineShape.height:=283.3;//
theInlineShape.width:=377.85;//修改长宽
=================================
使用TWordApplication控件,假设对象是WordApplication1,且已启动了Word
先声明变量
var
vSaveWithDocument: OleVariant;
vEmpty: OleVariant;
vStart: OleVariant;
vRange: OleVariant;
theInlineShape : InlineShape;
WordApplication1.Connect;
vEmpty := EmptyParam;
vSaveWithDocument := True;
vStart := WordApplication1.Selection.Start;
vRange := WordApplication1.ActiveDocument.Range(vStart, vStart);
theInlineShape := WordApplication1.ActiveDocument.inlineshapes.addpicture(edit1.Text, vEmpty,
vSaveWithDocument, vRange);//此句插入图片
WordApplication1.selection.typebackspace;//此句是为了将插入的图片选中
theInlineShape.height:=283.3;//
theInlineShape.width:=377.85;//修改长宽