Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set PreserveScrollPosition with Macro for Straight Table

Hi,

Please can someone help me with this.

How can the Preserve Scroll Position property on a straight table be changed using VBA?

I have found this following code using the API Guide, however it only seems to work with the Table Box object and not with the Straight Table object.

set mybox = ActiveDocument.GetSheetObject("LB01")

set mbp = mybox.GetProperties

mbp.Layout.Frame.PreserveScrollPosition = true

mybox.SetProperties mbp

Thanks.

1 Solution

Accepted Solutions
Not applicable
Author

I have worked out how to do this.

Just need to change Layout to GraphLayout!

set mybox = ActiveDocument.GetSheetObject("CH102")

  set mbp = mybox.GetProperties

  mbp.GraphLayout.Frame.PreserveScrollPosition = true

  mybox.SetProperties mbp

View solution in original post

3 Replies
Not applicable
Author

I have worked out how to do this.

Just need to change Layout to GraphLayout!

set mybox = ActiveDocument.GetSheetObject("CH102")

  set mbp = mybox.GetProperties

  mbp.GraphLayout.Frame.PreserveScrollPosition = true

  mybox.SetProperties mbp

m_woolf
Master II
Master II

Try:

set mybox = ActiveDocument.GetSheetObject("CH01")

set fr = mybox.GetFrameDef

fr.PreserveScrollPosition =true

mybox.SetFrameDef fr

Not applicable
Author

Thanks, m w, your code works too.