Monday, February 14, 2011

How do I delete a blank page Word VBA

While Microsoft Word does not have a button or a tool for each scenario, you create macros defined by the user, pieces of executable code by using Visual Basic for applications (VBA).

Macros can customize Word so that it fits your requirement. For example, have interspersed a document with empty pages, like it as your only option is to go through the document and manually delete the problematic pages. There is another solution: use a VBA macro, do the job the leg for you. Level of difficulty: Medium difficult

Instructions

You need: Word 2010 things
  1. 1

    Press "Alt" and "F11", put in the word delete draft of a document, the Visual Basic (LCA) editor to open.

  • 2

    Click "Insert" and "Modules", a blank window and then click module.

  • 3

    Cut and paste the following code into the module window blank: Public Sub DeleteBlankPage () Selection.GoTo,: = WdGoToBookmark, name: = "\page" for each c in Selection.CharactersIf IsBlankSelection ThenSelection.DeleteEnd IfEnd SubPublic BlankPageSelection () function (<> VbCr C and C <> VbTab <> VbFormFeed C and C <> "") = ThenBlankPageSelection FalseExit FunctionEnd IfNextBlankPageSelection = TrueEnd function

  • 4

    Press the "F5" key to run the routine and to remove the white pages of the document.

  • No comments:

    Post a Comment