Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Use the ImageHeight property to determine the height in twips of the picture in an image control. Read/write Long.
Syntax
expression.ImageHeight
expression A variable that represents an Image object.
Remarks
This property is read-only in all views.
Use the ImageHeight property together with the ImageWidth property to determine the size of a picture in an image control. You could then use this information to change the image control's Height and Width properties to match the size of the picture displayed.
Example
The following example prompts the user to enter the name of a bitmap and then assigns that bitmap to the Picture property of the Image1 image control. The ImageHeight and ImageWidth properties are used to resize the image control to fit the size of the bitmap.
Sub GetNewPicture(frm As Form)
Dim ctlImage As Control
Set ctlImage = frm!Image1
ctlImage.Picture = InputBox("Enter path and " _
& "file name for new bitmap")
ctlImage.Height = ctlImage.ImageHeight
ctlImage.Width = ctlImage.ImageWidth
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.