Top and left property for a form field inside a multipage control

S

Stephen Travis

The top and left properties of a form field that sits inside a multipage control are RELATIVE to the multipage controls top left
corner (including the tabs).

I'm trying to pop up a control below the form field without knowing if it's inside a multipage (or worse yet, inside a multipage
that's inside a multipage...)

Is there an easy way to get the top and left of a control relative to the page? Or is there a way to iterate through the parent
multipages to get to the top page?

TIA.
 
S

Stephen Travis

And to make matters worse, the multipage will not allow any form fields outside of itself to be visible when positioned over the
multipage (even if you bring it to the front) so even if I could locate the popup over the multipage, it wouldn't be visible. Looks
like I'm done.
 
K

Ken Slovak - [MVP - Outlook]

Stick the multipage control inside a frame control. That would fix your
problem. Then you can set the visibility of the control as you need. Within
a multipage you should be able to get the top and left of the multipage
control and use that as an offset from the form top and left and then apply
the relative top and left offsets of any control in the multipage.




Stephen Travis said:
And to make matters worse, the multipage will not allow any form fields
outside of itself to be visible when positioned over the
multipage (even if you bring it to the front) so even if I could locate
the popup over the multipage, it wouldn't be visible. Looks
 
S

Stephen Travis

Thanks Ken, I'm getting closer. The problem now is that the Top and Left properties seem to leave out part of the object. For
example, the MultiPage Top property is 16 pixels short of it's actual location. The Frame Top Property is 6 pixels short.

Since I'm using the Parent property to walk up the container tree, the script doesn't know whether its looking at a MultiPage or a
Frame. Do you know if the 'Type' of the container is available in script so I can adjust the size depending on the type of
container?
 
K

Ken Slovak - [MVP - Outlook]

No, there's no Type property that I know of. By default a Control has a name
such as Textbox.1 that could be used to identify the control but if the form
designer gave it another name you couldn't rely on that property. Offhand
the only thing I can think of is to try instantiating each Control as a
specific type of control like MSForms.Checkbox and see if you get an error
message. It sounds real ugly but it might work.

The controls in an Outlook form are from the MSForms 2.0 library, so you can
use the VBA Object Browser to see what's available for every control type if
you reference that library and select it in the Object Browser.




Stephen Travis said:
Thanks Ken, I'm getting closer. The problem now is that the Top and Left
properties seem to leave out part of the object. For
example, the MultiPage Top property is 16 pixels short of it's actual
location. The Frame Top Property is 6 pixels short.
Since I'm using the Parent property to walk up the container tree, the
script doesn't know whether its looking at a MultiPage or a
Frame. Do you know if the 'Type' of the container is available in script
so I can adjust the size depending on the type of
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top