
Tips.Net > WordTips Home > Macros > WordBasic Examples > Screen Flip Flop with WordBasic
Summary: A handy WordBasic macro that switches which of two document windows is displayed on top. (This tip works with Microsoft Word 6, and Word 95.)
There are many, many times when I work with two files at a time in Word. For instance, I may be reading one document and comparing it to another (and I don't want to use the Compare Documents feature). I always try to keep the document I am modifying in the top part of my screen, and the other document in the bottom part. Call it a personality quirk, but I find it easier to use the windows this way.
It can be a pain to repeatedly adjust the position of the windows and make sure that the proper file is at the top of the screen. Therefore, I developed a macro to handle this situation. You can use this handy little macro to switch which window is "on top" if you have two windows displayed on the screen. You will probably want to assign this to a toolbar button or a shortcut key, as it will be of little use if you need to keep calling it from the macro list. The following is the WordBasic version of the FlipFlop macro:
Sub MAIN
If CountWindows() = 2 Then
NextWindow
WindowArrangeAll
End If
End Sub
Notice that this macro only works if (and only if) there are two windows on the screen. If there is more or less, then the macro does nothing at all.
Tip #971 applies to Microsoft Word versions: 6 95
Great Idea! Word is a tool to get what you really want—printed output. This means you need to make sure that Word works as well as possible with your printer, whether it is sitting on your desk or in a room down the hall.
Check out WordTips: Printing and Printers today!
Learn to search for and replace text, formatting, graphics, and special characters the easy way with WordTips: Find and Replace. (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Word2007 Tips
WordTips