PPT2000: Table Converts to Autoshapes When Scaled Using VBA

ID: Q226720


The information in this article applies to:
  • Microsoft PowerPoint 2000


SYMPTOMS

When you run a macro that alters the height or width of a table cell in Microsoft PowerPoint 2000, the table may be converted into a Microsoft Office Drawing Object and will no longer be editable as a table.


CAUSE

When the table width or height properties are changed, the table is ungrouped. This is because the height and width properties only apply to the text box portion of each cell. Table cell height and width properties cannot be changed programatically in the PowerPoint object model without converting the table into autoshapes.


WORKAROUND

It is possible to scale a table as a complete object within PowerPoint by using either the ScaleWidth or ScaleHeight methods.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp

The following macro will scale a table by 75% without converting the table into autoshapes.

NOTE: A table must be selected or else this macro will return an error. If there is too much text for the table to resize properly, the width of the table will be scaled properly. The text will wrap to the new width, and the height will increase to accomodate the wrapped text.

Sub ScaleTable()
    With ActiveWindow.Selection.ShapeRange
        .ScaleWidth 0.75, msoFalse, msoScaleFromTopLeft
        .ScaleHeight 0.75, msoFalse, msoScaleFromTopLeft
    End With
End Sub 


STATUS

Microsoft has confirmed this to be a problem in Microsoft PowerPoint 2000.

Additional query words: PPT2K PPT2000 PPT POWERPNT 2000 PPT9 9.0

Keywords : kbcode kbdta kbdtacode kbtable
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: July 14, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.