How to insert and resize an image in Word?

浪尽此生 提交于 2020-12-11 08:59:48

问题


I have written a VBScript to automate the creation of a Word document.

I'm using the following code to insert an image, but I can't seem to find a way to then resize it.

objSelection.InlineShapes.AddPicture("C:\test.jpg")

回答1:


The AddPicture method returns a handle to the inserted object, so you could do something like this:

Set pic = objSelection.InlineShapes.AddPicture("C:\test.jpg")
pic.Height = 100
pic.Width  = 200


来源:https://stackoverflow.com/questions/28194878/how-to-insert-and-resize-an-image-in-word

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!