如何在Word中旋转图片 [英] How to rotate a picture in Word
问题描述
对于客户,我需要创建一个旋转文档中现有图片的宏。用途必须选择一张图片,然后启动宏来旋转它。
我看过几个例子,但是在添加图片时它们都会旋转。我正在使用现有的。
其他示例以错误结束。
目前我有这段代码:
Public Sub AfbeeldingDraaienLinksom()
Dim ilshp As InlineShape
Dim shp As Shape
设置ilshp = Selection.InlineShapes(1)
设置shp = ilshp.ConvertToShape
shp.IncrementRotation 90
结束子
我得到的错误是无法使用ConvertToShape。我不能在兼容模式下工作。
谁可以帮助我?
我尝试测试你的代码。
我发现你的代码没有任何错误。
你可以在下面看到测试结果。
如果你的代码给你一个错误,那么你可以尝试使用下面的代码也一样。
Sub demo()
Selection.ShapeRange.IncrementRotation 90#
End Sub
我测试了它,发现它也有效。
问候
Deepak
For a customer I need to create a macro that rotates a existing picture in the document. The uses has to select a picture and then start the macro to rotate it.
I've seen several examples, but they all rotate while adding the picture. And I'm working with existing ones.
The other examples end in errors.
At the moment I have this code:
Public Sub AfbeeldingDraaienLinksom()
Dim ilshp As InlineShape
Dim shp As Shape
Set ilshp = Selection.InlineShapes(1)
Set shp = ilshp.ConvertToShape
shp.IncrementRotation 90
End Sub
The error I get is that ConvertToShape is not possible. I don't work in Compatibilti Mode.
Who can help me?
I try to test your code on my side.
I find that your code is working without any error.
you can see the testing result below.
if your code is giving you an error then you can try to use code below will work same.
Sub demo() Selection.ShapeRange.IncrementRotation 90# End Sub
I tested it on my side and find that it's working too.
Regards
Deepak
这篇关于如何在Word中旋转图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!