none
The Height/Width of a picture in Microsoft Word document RRS feed

  • General discussion

  • What is the Height/Width of a picture in Microsoft Word?

    What I understand of the Height of a picture is from the top to the bottom of the picture in the Microsoft Word document, while the width is from the left to the right. However, when I insert a picture in the Microsoft Word document, it looks like not.

    The height is defined as from the left to the right which is 18.11cm while the width is defined as from the top to the bottom which is 27.16cm. I have tried changing the rotation, it has no effect. 


    questions:

    1.  is it possible to adjust the height to from the top to the bottom and the width to from the left to the right?

    2. how to get the rotation of the a picture(InlineShape) with VBA? 

    My Environment is:

    Windows 10+ Microsoft Office 2013.

    thanks

    Steven

     



    Friday, March 8, 2019 5:34 AM

All replies

  • Hi StevenLiu1970,
    1. Yes, it's possible
    2. Please refer to the below sample code.

    There are three shapes (the last/right is an picture).


    Wnen [CommandButton1] is clicked, you can see this. 


    [code in button]
    Private Sub CommandButton1_Click()
        Dim myShp As Shape
        For Each myShp In ThisDocument.Shapes
            ' --- show properties of shape
            MsgBox "Name = " & myShp.Name & Chr(13) _
                & "Type = " & myShp.Type & Chr(13) _
                & "Rotation = " & myShp.Rotation
            ' --- make width and height the same
            myShp.Width = 50
            myShp.Height = 30
        Next
    End Sub
    I hope it will be helpful.
    Regards,

    Ashidacchi -- https://ssl01.rocketnet.jp/hokusosha.com/default.html

    Friday, March 8, 2019 7:37 AM