VFP中控制WORD图片大小

作者在 2015-04-06 01:01:32 发布以下内容



lcFileName=GETPICT()
IF !FILE(lcFileName)
    MESSAGEBOX("请选择图片文件")
    RETURN
ENDIF
***请修改测试图片位置
oword=createobject("word.application")
oword.Visible=.t.
oword.Documents.add
oword.Selection.InlineShapes.AddPicture("D:\My Documents\My Pictures\图1.JPG",.f.,.t.)
?"文档中的图片个数:",oword.Documents(1).InlineShapes.Count      &&文档中图片个数
***按比例设置显示
oword.Documents(1).InlineShapes(1).ScaleWidth=50     &&图片显示宽比例
oword.Documents(1).InlineShapes(1).ScaleHeight=50    &&图片显示高比例
MESSAGEBOX("看一下WORD中的图片,是按 50%显示的",0+32,'test',3000)
***按像素设置显示
oword.Documents(1).InlineShapes(1).Height=50
oword.Documents(1).InlineShapes(1).Height=100
MESSAGEBOX("看一下WORD中的图片,是按 50 x 100显示的",0+32,'test',3000)
oword.ActiveDocument.SaveAs("c:\cxx.doc")
MESSAGEBOX("文档保存完毕")
RELEASE oword


来源:http://www.mzvfp.com/read.php?tid=57320&fpage=651
作者:雪心


Word | 阅读 2642 次
文章评论,共0条
游客请输入验证码
浏览380489次