Hi,
I've read a few samples on how to get a form to open central on the active window (active in my sense is the same window as Outlook, or other Office app is running), but it doesn't seem to work for me.
For reference, we have a mixture of screen setup's where I work:
Surface Pro's connected to a Surface Dock which in turn is connected to 1 or 2 external monitors. If 2, one can be portrait and the other landscape, or both landscape
Traditional PCs with 1 or 2 external monitors. Again, if 2, one can be portrait and the other landscape, or both landscape
There is no standard layout: the left or right can be either portrait on landscape, with the Surface some people have it as an active screen (to left, right or underneath) and some people have it disabled so just external monitors. With any setup, unless both are landscape the 'heights' of the monitors don't line up - I've attached an example (this is my personal Surface layout)
If I Debug.Print these:
(Application.ActiveWindow.Top + Application.ActiveWindow.Height / 2) - (Me.Height / 2)
(Application.ActiveWindow.Left + Application.ActiveWindow.Width / 2) - (Me.Width / 2)
this is what I get:
Outlook maximised on Surface screen:
2463.17500305176
-4379.625
Outlook maximized on landscape screen:
901.175003051758
1644.375
Outlook maximized on portrait screen:
989.175003051758
4644.375
I think this is where my problems arise?
Thanks
screen-layout.PNG
Bookmarks