Microsoft KB Archive/220126

= FP2000: Error Message: "Compile Error: Can't Assign to Read-Only Property" Using Position Property in VBA Macro to Move Table =

Article ID: 220126

Article Last Modified on 12/2/2000

-

APPLIES TO


 * Microsoft FrontPage 2000 Standard Edition

-



This article was previously published under Q220126



SYMPTOMS
When you attempt to move an absolutely positioned table by using a Visual Basic for Applications (VBA) macro similar to the following: Sub TablePosition1 Dim MyTable As FPHTMLTable Set MyTable = ActiveDocument.all.tags("table").Item(0) MyTable.Style.Position = "absolute" MyTable.Style.posLeft = MyTable.Style.posLeft + 40 MyTable.Style.posTop = MyTable.Style.posTop + 100 End Sub you may receive an error message similar to the following:

Compile error:

Can't assign to read-only property.



CAUSE
Internal implementation constraints in Internet Explorer 4.x set the Position property as read-only. This property is also read-only in FrontPage 2000.



RESOLUTION
To work around this problem, use the SetAttribute method to move the positioning of a table.

The following sample VBA macro moves a table by 40 pixels along the x-coordinate and by 400 pixels along the y-coordinate: Sub TablePosition2 Dim MyTable As FPHTMLTable Set MyTable = ActiveDocument.all.tags("table").Item(0) Call MyTable.Style.setAttribute("Position", "absolute") MyTable.Style.posLeft = MyTable.Style.posLeft + 40 MyTable.Style.posTop = MyTable.Style.posTop + 400 End Sub

Additional query words: front page fp2000 fp error message can t

Keywords: kbprb KB220126

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.