+ Reply to Thread
Results 1 to 1 of 1

User Form Startup Position

  1. #1
    Registered User
    Join Date
    11-09-2016
    Location
    London, England
    MS-Off Ver
    2010/2016
    Posts
    33

    User Form Startup Position

    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
    Last edited by ldoodle; 07-11-2018 at 06:36 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1