PPT2000: Table Converts to AutoShapes When Scaled Using VBA (226720)



The information in this article applies to:

  • Microsoft PowerPoint 2000

This article was previously published under Q226720

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 programmatically in the PowerPoint object model without converting the table into AutoShapes.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements.
It is possible to scale a table as a complete object within PowerPoint by using either the ScaleWidth or ScaleHeight methods.

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 accommodate 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 that this is a problem in Microsoft PowerPoint 2000.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbbug kbcode kbdtacode kbpending kbProgramming kbtable KB226720