WD: WordBasic Examples: AppWindowHeight/Width/PosLeft/PosTop |
Q106190
This article contains an example that demonstrates the use of the following WordBasic statements or functions:
AppWindowHeight AppWindowHeight()Note: On the Macintosh, these commands are not available and will generate errors.
AppWindowPosLeft AppWindowPosLeft()
AppWindowPosTop AppWindowPosTop()
AppWindowWidth AppWindowWidth()
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
AppWindowHeight [WindowName$,] Height
AppWindowHeight([WindowName$])
Example:
Sub MAIN
x = 0
state = AppMaximize()
If state = - 1 Then AppRestore
x = AppWindowHeight()
MsgBox "The height of this window is: " + Str$(x)
AppWindowHeight x - 100
MsgBox "The height of this window is: " + Str$(x - 100)
End Sub
AppWindowPosLeft [WindowName$,] HorizPos
AppWindowPosLeft([WindowName$])
Example:
Sub MAIN
state = AppMaximize()
If state = - 1 Then AppRestore
x = AppWindowPosLeft()
MsgBox "The distance from the left is: " + Str$(x)
AppWindowPosLeft x + 100
MsgBox "The distance from the left is: " + Str$(x +100)
End Sub
AppWindowPosTop [WindowName$,] VertPos
AppWindowPosTop([WindowName$])
Example:
Sub MAIN
x = 0
state = AppMaximize()
If state = - 1 Then AppRestore
x = AppWindowPosTop()
MsgBox "The distance from the top is: " + Str$(x)
AppWindowPosTop x + 100
MsgBox "The distance from the top is: " + Str$(x + 100)
End Sub
AppWindowWidth [WindowName$,] Width
AppWindowWidth([WindowName$])
Example:
Sub MAIN
x = 0
state = AppMaximize()
If state = - 1 Then AppRestore
x = AppWindowWidth()
MsgBox "The width of this window is: " + Str$(x)
AppWindowWidth x / 2
MsgBox "The width of this window is: " + Str$(x / 2)
End Sub
Additional query words:
Keywords : wordnt kbmacroexample ntword word6 word7 word95
Issue type : kbinfo
Technology :
|
Last Reviewed: November 4, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |