While Microsoft Word doesn't have a button or tool for every possible scenario, you can create user-defined macros, pieces of executable code, using Visual Basic for Applications (VBA). Macros can tailor Word to fit your needs. For example, if you have a document interspersed with blank pages, it might seem like your only option is to manually go through the document and delete the offending pages. There is another option: use a VBA macro to do the leg work for you.
Things You'll Need
- Word 2010
Press "Alt" and "F11" together in the Word document you want to remove blanks from to open the Visual Basic Editor (VBE).
Click "Insert" and then click "Module" to insert a blank module window.
Cut and paste the following code into the blank module window:
Public Sub DeleteBlankPage()
Selection.GoTo What:=wdGoToBookmark, Name:="\page"
If isBlankSelection Then
Public Function BlankPageSelection()
For Each c In Selection.Characters
If (c <> vbCr And c <> vbTab And c <> vbFormFeed And c <> " ") Then
BlankPageSelection = False
BlankPageSelection = True
Press "F5" to run the routine and delete the blank pages from your document.
Tips & Warnings
- You can use the same code at a later date: The code will save along with your Word document. Open the VBE and then click "DeleteBlankPage" from the left hand sidebar. Press "F5" to run the routine.