Re: Remove spaces (Hard-returns) at top of pages

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Yes, I know your frustration now, me trying to convey the problem, you trying
to try and make out what on earth I am on about.

Why cant it be as simple as some script that checks each page, removes all
ASCI code for line breaks until it finds a text string and then goes on to
the next page, sounds so simple, but alas I have no clue of doing VB in word,
or writing any other script (so for me it is 100% impossible) other than to
come up with the concept.

Go and have fun with the family, Im on my way home too, will check tomrow
morning again (so that gives you over 12 hours before I am back again)

I have used some styles to some extend, but still (Also note here - I am not
trying to remove extra spaces, the thing is the paragraph might end just on
the last line of the page, on the next page it should by all means add a line
break to go into the next parag. or point, but now there is Lecturers who
demand that each page must start without that bloody space) ... maybe they
just want to be difficult?

Thanks Tony, Im trying to figure out your code you send first time to see if
I can get it to check each page... and obviously I am not getting anywhere ;-)

Anton

"Tony Jollans" wrote:

Hmmm - the first will remove - completely remove - multiple consecutive
occurrences of (either space or paragraph mark) so a paragraph ending in a
space will get cleared. This is one of the difficulties of doing this sort
of thing remotely :)

Now I understand what you are trying to do, the real answer is to use Styles
with the formatting you want in the first place instead of trying to lay out
your document with extra spaces and lines. A well formatted document will
never have extra spaces and paragraph marks anywhere and the proper use of
styles will make it easier to work with as well and no reformatting needed.

I have to go out now - I'm afraid my family are more important to me than
you are :) - but if nobody else jumps in I will post back in, maybe, three
hours.

--
Enjoy,
Tony

"Ant (antonfh_at_gmail_dot_com)"
<Antantonfhatgmaildotcom@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FE0A4D57-72EB-4C3F-AB8E-CCE9EEA6817A@xxxxxxxxxxxxxxxx
Tony Jolians.

First of thank you for your time and assistance.

Ok I tried the find and replace, the first one with the replace of \1
worked
in a way, but it took away some hard-returns, resulting in one big
paragraph
for example, the other one with the replace of \1\2 did not seem to remove
the line breaks at top of pages.

The piece of code you send first time actually worked like a charm, if
only
on the first page of the document, if that code could run for each page of
the document that would be the ideal situation.

You see the thing with this is that this is a project for a assignment and
the lecturers are very specific that they dont allow any space at the top
of
the page (now I ask you with tears in my eyes, how are you supposed to
reformat your document each time and take out spaces at the top of a page
without using some script ?)

Thank you for your help.


Anton

"Tony Jollans" wrote:

Unless you have hard page breaks all over the place then what is at the
top
of page 2, say, will change when you delete content from the top of page
1 -
so doing this by page doesn't really make sense.

If you want to replace ALL multiple instances of spaces and returns you
could use a Find and Replace of ---

Find [^13 ]{2,}([!^13 ]) - if I've typed correctly that should be left
(square) bracket, caret, one, three, space, right bracket, left brace,
two,
comma, right brace, left parenthesis, left bracket, exclamation mark,
caret,
one, three, space, right bracket, right parenthesis.

Replace \1 - that's backslash, one

Check Use Wildcards and hit Replace All

If you do have manual page breaks then you can search for multiple
spaces
following them with ---

Find string of (^m)[^13 ]{1,}([!^13 ]) - that's as above preceded by
left
parenthesis, caret, lower case letter em, right parenthesis and with the
two
inside the braces replaced with a one.
And a Replace string of \1\2

Please come back if it's something differeent.

--
Enjoy,
Tony

"Ant (antonfh_at_gmail_dot_com)"
<Antantonfhatgmaildotcom@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AA03B86C-B7DD-4A23-AFD2-868063815D19@xxxxxxxxxxxxxxxx
Tony.

No no, not the top of the document, at the top of certain pages, I
have 7
documents, some with over 500 pages, so for me to go and try to find a
space
(or more) at the top of a page and deleting them by hand is not that
easy,
and then someone changes the document and I have to do a search and
find
all
over again to make sure each page of the 500 page document has no
spaces
at
the top ...thats where the problem comes in.

Thanks for the code, going to try it now.

Anton

"Tony Jollans" wrote:

I don't see why you 'obviously' have lots of spaces and returns at
the
start
of a document - but if that's all you want to get rid of you're not
going to
find anything a whole lot easier than going to the top of the
document
and
doing it manually

I just did a search for the first non-space non-paragraph mark and
recorded
this if it helps ...

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 28/03/2006 by Tony
'
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[!^13 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdStory, Extend:=wdExtend
Selection.TypeBackspace
End Sub


--
Enjoy,
Tony

"Ant (antonfh_at_gmail_dot_com)"
<Ant(antonfh_at_gmail_dot_com)@discussions.microsoft.com> wrote in
message
news:A10E3648-7239-4F4A-B280-76712D9AACA2@xxxxxxxxxxxxxxxx
How can I remove all spaces (lines) aka? Hard-returns at the top
of a
page
in
my document, is there a macro I can do this with.

It should be something to write as "clean-up-process" after
editing a
doc,
since any editing would move text around again and obviously
result in
some
spaces at the top of a doc.

I tried to look for some examples but most removes all line breaks
or
hard-returns, I am looking only for something that will find
theses
spaces
(breaks) at the top of the page and remove them up to the first
line
of
text
on that page.

Hope this makes sense









.



Relevant Pages

  • Re: Remove spaces (Hard-returns) at top of pages
    ... Im trying to figure out your code you send first time to see ... "Tony Jollans" wrote: ... occurrences of (either space or paragraph mark) so a paragraph ending in ... ' Macro2 Macro ...
    (microsoft.public.word.docmanagement)
  • Opening paragraphs of recent PODs that yielded an abbreviated read -- PODdy mouth
    ... "So many folks have asked me how bad a book must be to only read one sentence or paragraph before closing it. ... The first time I saw ... # The rain, wet, cold, misty and murky, fell on our saturated, pruned skin, had us running the cold, hard pavement with such animated and excited fury, that we fell in laughter when we returned to the warm, dry fire. ...
    (misc.writing)
  • latex bug with line spacing
    ... with the word "Some", when it appears the first time, the lines are too ... The problem goes away the second time the paragraph ... function wmask = findbasis ...
    (comp.text.tex)
  • Re: Hardware Monitor found an error
    ... If not understood the first time, ... what can cause freezing is one paragraph. ... failure on drive says nothing about what froze a system. ... If error report is not ...
    (microsoft.public.windowsxp.basics)