Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » Microsoft Word (Часть 1)

Модерирует : gyra, Maz

Widok (16-03-2006 15:02): http://forum.ru-board.com/topic.cgi?forum=5&topic=18912  Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

kuku1375

Advanced Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
Public Sub WindowTileVertical()
 
Dim oWind As Window ' working object
Dim nActiveWindowIndex As Long ' save to reactivate at end
 
Dim nNonMinWindows() As Long ' list of nonminimized windows
Dim nNonMinWindowsCount As Long ' length of the list
 
Dim nScreenWidth As Long ' width & height of full
Dim nScreenHeight As Long ' screen in points
 
Dim nDesiredWidth As Long ' width each window should be
Dim nIndex As Long ' For loop index
 
' Save active window's index
nActiveWindowIndex = ActiveWindow.Index
 
' Find out how many Word windows are not minimized  
' (i.e., maximized or normal), and store them in the
' nNonMinWindows array
nNonMinWindowsCount = 0
For Each oWind In Windows
    If oWind.WindowState <> wdWindowStateMinimize Then
        nNonMinWindowsCount = nNonMinWindowsCount + 1
        ReDim Preserve nNonMinWindows(nNonMinWindowsCount - 1)
        nNonMinWindows(nNonMinWindowsCount - 1) = oWind.Index
    End If
Next oWind
 
If nNonMinWindowsCount < 1 Then Exit Sub
 
' Maximize the current window,  to get the
' screen width and height in points
With ActiveWindow
    .WindowState = wdWindowStateMaximize
    nScreenWidth = .Width
    nScreenHeight = .Height
End With
 
' The desired width is the screen width
' divided by the number of windows being tiled
nDesiredWidth = nScreenWidth / nNonMinWindowsCount
 
' Set each window to the desired size. Offset each one
' horizontally to sit to the right of the one before.
 
For nIndex = 0 To nNonMinWindowsCount - 1
    Set oWind = Windows(nNonMinWindows(nIndex))
 
    With oWind
        .Activate
        .WindowState = wdWindowStateNormal
 
        .Width = nDesiredWidth
        .Height = nScreenHeight
 
        .Top = 0
        .Left = nIndex * nDesiredWidth
    End With
 
Next nIndex
 
Set oWind = Nothing
Windows(nActiveWindowIndex).Activate
 
End Sub

Всего записей: 1068 | Зарегистр. 12-03-2005 | Отправлено: 07:27 27-12-2005
   

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » Microsoft Word (Часть 1)
Widok (16-03-2006 15:02): http://forum.ru-board.com/topic.cgi?forum=5&topic=18912


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru