#1   Report Post  
Dano O'D
 
Posts: n/a
Default 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   Report Post  
Anne Troy
 
Posts: n/a
Default

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   Report Post  
Dano O'D
 
Posts: n/a
Default

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   Report Post  
Dano O'D
 
Posts: n/a
Default

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   Report Post  
Anne Troy
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page number difficulties Tjodrik Microsoft Word Help 3 May 9th 05 02:54 PM
how do you delete an entire page? Larrydom New Users 2 February 21st 05 09:36 PM
Odd page section break Jenny Page Layout 5 December 15th 04 08:05 AM
FIrst page footers Noel S Pamfree Microsoft Word Help 7 December 6th 04 08:49 PM
Insert objects at page breaks DRS - Jonathan Microsoft Word Help 4 November 29th 04 07:16 PM


All times are GMT +1. The time now is 01:28 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"