- #How to add or delete a page in microsoft word how to
- #How to add or delete a page in microsoft word windows 10
- #How to add or delete a page in microsoft word code
#How to add or delete a page in microsoft word how to
How to run the VBA procedure to delete pages in Word Now, let’s run the procedure and see how it works. If you’re working in the menu version, you can skip this step. If you are using a ribbon version, be sure to save the workbook as a macro-enabled file. Doing so will remove any phantom web characters that might otherwise cause errors.
#How to add or delete a page in microsoft word code
Instead, copy the code into a text editor and then paste that code into the ThisWorkbook module. If you enter the code manually, don’t paste from this web page. In addition, the macro is in the downloadable. You can enter the code manually or import the downloadable. In the Project Explorer to the left, select ThisWorkbook so you can run the procedure in any sheet.
![how to add or delete a page in microsoft word how to add or delete a page in microsoft word](https://i1.wp.com/www.myofficetricks.com/wp-content/uploads/2019/07/10-1.jpg)
To enter the procedure, press Alt + F11 to open the Visual Basic Editor. If you’re familiar with VBA, you can probably skip this section and move right on to running the macro to see how it works. It will delete the contents of the last page, but it won’t delete the page, so you won’t want to run this with the last page selected. If you select multiple contiguous pages, the procedure deletes the first page in the grouping. To delete a bookmark, you would reference it by name and omit the Range property. If you omit the Range property, the statement returns an error because VBA attempts to delete the Page bookmark you can’t delete it or modify it because it’s read-only. The Range property specifies the page and the Delete method deletes it. ‘Run procedure to delete the current page.ĪctiveDocument.Bookmarks(“Page”).Range.DeleteĪs mentioned, the Page bookmark is a special reference to the current page. (You’ll often see the terms macro and sub procedure used interchangeable, and that’s OK.) It’s only one line, thanks to a system-defined bookmark, Page, which refers to the current page. You might be surprised how short the procedure needed to delete the current page is. For your convenience, you can download the demonstration.
#How to add or delete a page in microsoft word windows 10
I’m using Microsoft 365 on a Windows 10 64-bit system, but you can use earlier versions. SEE: Windows 10: Lists of vocal commands for speech recognition and dictation (free PDF) (TechRepublic) Even if you don’t need the procedure, you can learn how to create a keyboard shortcut. In addition, I’ll show you how to assign a keyboard shortcut to the procedure so you can execute it quickly. In this article, I’ll show you two VBA procedures that will delete the current page.
![how to add or delete a page in microsoft word how to add or delete a page in microsoft word](https://erinwrightwriting.com/wp-content/uploads/2021/05/Word-365-Insert-Tab_v8.jpg)
You probably don’t mind doing so occasionally, but if you have to do this a lot, you might find doing so tedious. You must delete the content and the soft or hard page break. How to reset your Windows 10 password when you forget itĭeleting a page in a Microsoft Word document isn’t difficult, but there’s no quick-click route. Image: BigTunaOnline/Shutterstock Must-read Windows coverageĭefend your network with Microsoft outside-in security services If you work with long Microsoft Word documents and frequently have to delete pages, you'll appreciate this simple VBA procedure.
![how to add or delete a page in microsoft word how to add or delete a page in microsoft word](https://www.customguide.com/images/lessons/word-2019/word-2019--page-breaks--03.png)
How to use a VBA procedure that deletes the current page in a Word document