WD97: Returned Height for Inline Shape Different from Specified

Last reviewed: February 11, 1998
Article ID: Q163910
The information in this article applies to:
  • Microsoft Word 97 for Windows

SYMPTOMS

In Visual Basic for Applications, when you create an InlineShape object and set the height using the Height property, the value returned by the Height property for the shape does not equal the value used to set the height.

For example, the following Visual Basic for Applications macro creates a Microsoft Excel worksheet object. The macro sets the height of the object to 200 points. However, when the Height property is used in its functional form to return the height of the object, the value returned equals 200.25 points.

   Sub GetObjectHeight()
      Dim oILShp1 As Object
      ' Create the object
      Set oILShp1 = ActiveDocument.InlineShapes.AddOLEObject _
      (ClassType:="Excel.Sheet.8", DisplayAsIcon:=False, _
      Range:=ActiveDocument.Paragraphs(1).Range)
      ' Set the object height
      oILShp1.Height = 200
      ' Return the object height.
      MsgBox oILShp1.Height
   End Sub

STATUS

Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The Height property can be used to return or set the height of a specified inline shape.

Keywords          : kb3rdparty kbinterop kbole kbprg kbwordvba
Version           : 97
Platform          : WINDOWS


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 11, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.