Deleting a page forcibly

H

Hari Prasadh

Hi,

I want to delete a particular *real page*.

Like many times if I copy data from let's say Web/ some software etc and
paste in to Word (I use word for Printing only !!!) then the last page would
be having no data (atleast it would be blank as far as am able to see) but
still even if am sitting on the period after the last letter in the Main
Story and if i keep pressing delete the Last page just wouldnt get deleted.

Why does this happen?

Is there a VBA solution to it (and yes, would be happy to know non-VBA
solution as well)

Thanks a lot,
Hari
India
 
H

Helmut Weber

High Hari,
every page in a doc contains data.
It may be only a pagebreak or the end-of-doc-mark,
which is kind of under the last paragraph mark.
A page that contains no data would be non existing.

I don't know exactly, what your problem is,
but there are cases, where the last page,
which may not hold any character visible on paper,
can't be deleted. For example, if a table fills
the entire second last page, then this may push
the last paragraph and the underlying end-of-doc-mark
to a new page, which would then be the apparently empty last page.
It often helps to reduce the font size of the last paragraph
mark to 1 point.
To clear the doc's end from empty paragraphs,
you may use a construction like this:

With ActiveDocument.Paragraphs
While .Last.Range.Text = vbCr
.Last.Range.Delete
Wend
End With

But if the content of a doc has been pasted
from a web-site, the paragraph mark needn't
necessarily be VbCr, I think.

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
H

Hari Prasadh

Hi Helmut,

Thnx for your response and especially a detailed explanation has been
extremely helpful.
But if the content of a doc has been pasted
from a web-site, the paragraph mark needn't
necessarily be VbCr, I think.

A week back I went to http://word.mvps.org/FAQs/Formatting/CleanWebText.htm
and learned some great tips on simplifying the cleaning process.

Actually the present problem used to happen sometimes when I used to copy
from custom softwares .(Also, whenever the present problem happened in the
case of web pasting, then Line breaks / word wrap was not an issue. Thats
why I was stumped).

Now, things are fine with your kind help.

Thanks a lot,
Hari
India
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top