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.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Cezi
Femeie
23 ani
Vaslui
cauta Barbat
27 - 80 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [WORD] Move ActiveWindow to The 2nd Monitor and Back [VBA] Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 748
Source:(Word-2002



' CHECK PROPERTIES OF ACTIVE WINDOW ON EACH MONITOR
Sub CheckObjectProps()
Dim winActive As Window
Set winActive = ActiveWindow
    Debug.Print winActive.WindowState 'open Immediate window (CTRL+G) to see values
                '1 = wdWindowStateMaximize, 0 = wdWindowStateNormal, 2 = wdWindowStateMinimize
    Debug.Print winActive.Height 'open Immediate window (CTRL+G) to see values
    Debug.Print winActive.Width 'open Immediate window (CTRL+G) to see values
    Debug.Print winActive.Top 'open Immediate window (CTRL+G) to see values
    Debug.Print winActive.Left 'open Immediate window (CTRL+G) to see values
    Stop ' open Locals window to inspect more properties of winActive
Set winActive = Nothing
End Sub

Sub ToMonitor()
Dim winActive As Window
Set winActive = ActiveWindow
Application.ScreenUpdating = False

With winActive
    .WindowState = wdWindowStateNormal
    .Height = 816 'laptop = 507
    .Width = 1446 'laptop = 1031
    .Top = -237 'laptop = -3
    .Left = -1443 'laptop = -3
    .WindowState = wdWindowStateMaximize
End With
Application.ScreenUpdating = True
End Sub

Sub ToLaptop()
Dim winActive As Window
Set winActive = ActiveWindow
Application.ScreenUpdating = False

With winActive
    .WindowState = wdWindowStateNormal
    .Height = 507 'monitor = 816
    .Width = 1031 'monitor = 1446
    .Top = -3 'monitor = -237
    .Left = -3 'monitor = -1443
    .WindowState = wdWindowStateMaximize
End With

Application.ScreenUpdating = True
End Sub



Modificat de TRaP (acum 5 ani)


pus acum 5 ani
   
TRaP
Moderator

Inregistrat: acum 6 ani
Postari: 748
CheckObjectProps updated with Debug.Print options for easier view of the properties.

pus acum 5 ani
   
Pagini: 1  

Mergi la