社区
C#
帖子详情
word中插入图片的问题!
lytone52
2006-04-08 12:25:51
想在word中插入图片,并希望图片保持固定的大小,用以下代码 oWordApplic.Selection.InlineShapes.AddPicture(fileName,ref missing,ref missing,ref missing);
但是插入后,图片是原先的尺寸。请问如何控制图片的大小?
...全文
966
9
打赏
收藏
word中插入图片的问题!
想在word中插入图片,并希望图片保持固定的大小,用以下代码 oWordApplic.Selection.InlineShapes.AddPicture(fileName,ref missing,ref missing,ref missing); 但是插入后,图片是原先的尺寸。请问如何控制图片的大小?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
蒋晟
2006-04-08
打赏
举报
回复
看看http://support.microsoft.com/kb/306683
lytone52
2006-04-08
打赏
举报
回复
jiangsheng(蒋晟.Net[MVP]) ( ) 信誉:110 2006-04-08 13:34:00 得分: 0
改一下visible属性就可以了
------------------------------
在什么时候改?我是这样:
oWordApplic = new ApplicationClass();
oWordApplic.Visible = true;
-------------------------------
但是不能打开,也就是没出现word窗口
wfhlxl
2006-04-08
打赏
举报
回复
Microsoft.Office.Interop.Word.Application aa = new Microsoft.Office.Interop.Word.ApplicationClass();
aa.InchesToPoints((float)0.11);
代码蜗牛sky
2006-04-08
打赏
举报
回复
object filename = @"C:\Inetpub\wwwroot\TestWebApp\test.doc";//文件名
Word.Application a = new Word.ApplicationClass();//建立一个Word程序对像
object Nothing = System.Reflection.Missing.Value;//空值
Word.Document b = a.Documents.Open(ref filename,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing);//建立一个Word文档对像
//其实这步就是执行了这个宏
InlineShape shape = a.Selection.InlineShapes.AddPicture(@"C:\Documents and Settings\Administrator\桌面\2003121512223366481.jpg",ref Nothing,ref Nothing,ref Nothing);
shape.Height = InchesToPoints(0.5)
shape.Width = InchesToPoints(0.5)
//Selection.InlineShapes.AddPicture FileName:= "C:\Documents and Settings\Administrator\桌面\2003121512223366481.bmp", LinkToFile:=False, SaveWithDocument:=True End Sub b.Save();//保存
b.Close(ref Nothing,ref Nothing,ref Nothing);//关闭Word文档
a.Quit(ref Nothing,ref Nothing,ref Nothing);//退出Word程序
蒋晟
2006-04-08
打赏
举报
回复
改一下visible属性就可以了
lytone52
2006-04-08
打赏
举报
回复
知道怎么用了,谢谢大侠。再问个问题,分不够再加,我如何让我生成的word文档保持为打开,就是说给用户显示。
wfhlxl
2006-04-08
打赏
举报
回复
pic=Selection.InlineShapes.AddPicture _
"filename"
lytone52
2006-04-08
打赏
举报
回复
楼上的高手能说一下c#里怎么用InchesToPoints这个方法吗?
蒋晟
2006-04-08
打赏
举报
回复
myShape = Selection.InlineShapes.AddPicture ......
myShape.Height = InchesToPoints(0.85)
myShape.Width = InchesToPoints(0.75)
计算机
word
怎么
插入图片
,
word
如何
插入图片
Word
2003如何插入电脑
中
图片
对于很多高手来说这个可能并不是一个
问题
,但是对于很多菜鸟来说关于
word
如何
插入图片
这个
问题
还是有点难度的,但是今天这篇
word
如何
插入图片
Word
2003如何插入电脑
中
图片的文章就是帮助菜鸟们解决这些
问题
的,菜鸟...
使用JAVA向
word
中
插入图片
使用java向
word
中
插入图片
...因为在使用POI在wrod
中
插入图片
时,我们会出现图片显示不出来的
问题
。在
word
中
插入图片
代码如下 public static void main(String[] args)throws Exception { // 创建一个document对...
Microsoft
Word
教程:如何在
Word
中
插入图片
、图标?
欢迎观看 Microsoft
Word
教程,小编带大家学习 Microsoft
Word
的使用技巧,了解如何在
Word
中
插入图片
、图标。
C#在
Word
表格
中
插入图片
调整大小Debug
C#在
Word
表格
中
插入图片
调整大小Debug一、C#在
Word
表格
中
插入图片
并调整大小二、设置单元格大小随图片大小变化 一、C#在
Word
表格
中
插入图片
并调整大小 C#编程
中
在
word
中
和
Word
表格
中
插入图片
是使用InlineShapes....
word
插入图片
偏右
问题
通常在
word
中
插入图片
,当图片较大时会向右边延伸出去。如下图: 默认嵌入型,因为图片较大超出了纸张范围(绿色框)。但是左侧又有很大空间(蓝色框)。 调整方法 方式一: 可以点击图片,在四角手动拖动鼠标...
C#
110,545
社区成员
642,580
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章