Simpatie.ro - matrimoniale
Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Nou pe simpatie:
mary24 la Simpatie.ro
Femeie
24 ani
Braila
cauta Barbat
25 - 56 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[OUTLOOK] Move ActiveWindow to The 2nd Monitor and Back [VBA]

Pagini: 1 Moderat de TRaP, TonyTzu
#1
TRaP
Moderator
Postari: 960
Use the first code below to check the dimensions required on your monitors, then update the 2nd and 3rd codes with those dimensions for height, width, top, left.


' CHECK PROPERTIES OF ACTIVE WINDOW ON EACH MONITOR
Sub CheckObjectProps()
    Debug.Print Application.ActiveWindow.WindowState 'open Immediate window (CTRL+G) to see values
                '0 = olMaximized, 1 = olMinimized, 2 = olNormalWindow
    Debug.Print Application.ActiveWindow.Height 'open Immediate window (CTRL+G) to see values
    Debug.Print Application.ActiveWindow.Width 'open Immediate window (CTRL+G) to see values
    Debug.Print Application.ActiveWindow.Top 'open Immediate window (CTRL+G) to see values
    Debug.Print Application.ActiveWindow.Left 'open Immediate window (CTRL+G) to see values
    Stop
End Sub

Sub ToMonitor()
    Application.ActiveWindow.WindowState = olNormalWindow
    Application.ActiveWindow.Height = 1096
    Application.ActiveWindow.Width = 1936
    Application.ActiveWindow.Top = -320
    Application.ActiveWindow.Left = -1928
    Application.ActiveWindow.WindowState = olMaximized
End Sub

Sub ToLaptop()
    Application.ActiveWindow.WindowState = olNormalWindow
    Application.ActiveWindow.Height = 658
    Application.ActiveWindow.Width = 1382
    Application.ActiveWindow.Top = -8
    Application.ActiveWindow.Left = -8
    Application.ActiveWindow.WindowState = olMaximized
End Sub


 
   
Pagini: 1  
Mergi la