Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Deleting Entire Page
Hello,
I'm setting up a template and would like to create a macro to delete an entire page at once if the user so chooses. The problem is that when I create the macro to delete line by line and the page is edited, the macro does not delete the information that was added by the user and the macro gives an error message. I'm thinking the only solution to this is to build the macro so that it highlights the entire page at one time, regardless of what was added or deleted, and deletes the entire page at once. Is there any command (macro, keyboard shortcut, etc.) that can delete an entire page in Word at one time? Thanks for any suggestions, Dan |
#2
|
|||
|
|||
Hi, Dan. This macro selects the entire page. I'm sure you can just add
"delete" to it. http://www.vbaexpress.com/kb/getarticle.php?kb_id=43 ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Dano O'D" wrote in message ... Hello, I'm setting up a template and would like to create a macro to delete an entire page at once if the user so chooses. The problem is that when I create the macro to delete line by line and the page is edited, the macro does not delete the information that was added by the user and the macro gives an error message. I'm thinking the only solution to this is to build the macro so that it highlights the entire page at one time, regardless of what was added or deleted, and deletes the entire page at once. Is there any command (macro, keyboard shortcut, etc.) that can delete an entire page in Word at one time? Thanks for any suggestions, Dan |
#3
|
|||
|
|||
Hi Anne,
Thanks for the tip, this looks promising. Unfortunately, I'm not very familiar with Visual Basic. I tried adding "Delete" and "Del" to the code, but that doesn't seem to be working. Any tips on how to write the code for delete correctly? Thanks again, Dan "Anne Troy" wrote: Hi, Dan. This macro selects the entire page. I'm sure you can just add "delete" to it. http://www.vbaexpress.com/kb/getarticle.php?kb_id=43 ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Dano O'D" wrote in message ... Hello, I'm setting up a template and would like to create a macro to delete an entire page at once if the user so chooses. The problem is that when I create the macro to delete line by line and the page is edited, the macro does not delete the information that was added by the user and the macro gives an error message. I'm thinking the only solution to this is to build the macro so that it highlights the entire page at one time, regardless of what was added or deleted, and deletes the entire page at once. Is there any command (macro, keyboard shortcut, etc.) that can delete an entire page in Word at one time? Thanks for any suggestions, Dan |
#4
|
|||
|
|||
Hi Anne,
Ignore my last post, I figured it out. Just had to write "Selection.Delete" and that did the trick. Thanks for the help, this is great. Dan "Dano O'D" wrote: Hi Anne, Thanks for the tip, this looks promising. Unfortunately, I'm not very familiar with Visual Basic. I tried adding "Delete" and "Del" to the code, but that doesn't seem to be working. Any tips on how to write the code for delete correctly? Thanks again, Dan "Anne Troy" wrote: Hi, Dan. This macro selects the entire page. I'm sure you can just add "delete" to it. http://www.vbaexpress.com/kb/getarticle.php?kb_id=43 ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Dano O'D" wrote in message ... Hello, I'm setting up a template and would like to create a macro to delete an entire page at once if the user so chooses. The problem is that when I create the macro to delete line by line and the page is edited, the macro does not delete the information that was added by the user and the macro gives an error message. I'm thinking the only solution to this is to build the macro so that it highlights the entire page at one time, regardless of what was added or deleted, and deletes the entire page at once. Is there any command (macro, keyboard shortcut, etc.) that can delete an entire page in Word at one time? Thanks for any suggestions, Dan |
#5
|
|||
|
|||
Good deal, Dano. I'm no coder. That's why I created that website. So people
like me and you can steal code without guilt. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Dano O'D" wrote in message ... Hi Anne, Ignore my last post, I figured it out. Just had to write "Selection.Delete" and that did the trick. Thanks for the help, this is great. Dan "Dano O'D" wrote: Hi Anne, Thanks for the tip, this looks promising. Unfortunately, I'm not very familiar with Visual Basic. I tried adding "Delete" and "Del" to the code, but that doesn't seem to be working. Any tips on how to write the code for delete correctly? Thanks again, Dan "Anne Troy" wrote: Hi, Dan. This macro selects the entire page. I'm sure you can just add "delete" to it. http://www.vbaexpress.com/kb/getarticle.php?kb_id=43 ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Dano O'D" wrote in message ... Hello, I'm setting up a template and would like to create a macro to delete an entire page at once if the user so chooses. The problem is that when I create the macro to delete line by line and the page is edited, the macro does not delete the information that was added by the user and the macro gives an error message. I'm thinking the only solution to this is to build the macro so that it highlights the entire page at one time, regardless of what was added or deleted, and deletes the entire page at once. Is there any command (macro, keyboard shortcut, etc.) that can delete an entire page in Word at one time? Thanks for any suggestions, Dan |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Page number difficulties | Microsoft Word Help | |||
how do you delete an entire page? | New Users | |||
Odd page section break | Page Layout | |||
FIrst page footers | Microsoft Word Help | |||
Insert objects at page breaks | Microsoft Word Help |