您好,我正在尝试弄清楚如何将变量定义为属性,我将编写一些代码来显示我的意思。
谢谢
'i want to call the Selection.ShapeRange.Width
Set img = Selection.ShapeRange ' -- Looks Ok here
img.width = 200 ' -- Works good
set largo = img.width
largo = 200 ' Here the selected image should be enlarged to 200px Crash :(
答案 0 :(得分:0)
当您拥有two values you want to swap(此处是Height
的{{1}}和Width
属性值)时,您只需要一个变量来保存值之一: / p>
Shape
然后,您可以从暂时存储在局部变量中的属性开始进行交换:
Dim originalHeight As Double
originalHeight = img.Height