Re: Remove spaces (Hard-returns) at top of pages
- From: Ant(antonfh_at_gmail_dot_com) <Antantonfhatgmaildotcom@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Mar 2006 06:40:05 -0800
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.worked
First of thank you for your time and assistance.
Ok I tried the find and replace, the first one with the replace of \1
in a way, but it took away some hard-returns, resulting in one bigparagraph
for example, the other one with the replace of \1\2 did not seem to removeonly
the line breaks at top of pages.
The piece of code you send first time actually worked like a charm, if
on the first page of the document, if that code could run for each page ofof
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
the page (now I ask you with tears in my eyes, how are you supposed totop
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
1 -of page 2, say, will change when you delete content from the top of page
two,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,
caret,comma, right brace, left parenthesis, left bracket, exclamation mark,
spacesone, 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
leftfollowing them with ---
Find string of (^m)[^13 ]{1,}([!^13 ]) - that's as above preceded by
twoparenthesis, caret, lower case letter em, right parenthesis and with the
have 7inside 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
easy,documents, some with over 500 pages, so for me to go and try to find aspace
(or more) at the top of a page and deleting them by hand is not that
findand then someone changes the document and I have to do a search and
spacesall
over again to make sure each page of the 500 page document has no
theat
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
documentstart
going toof a document - but if that's all you want to get rid of you're not
find anything a whole lot easier than going to the top of the
of aand
recordeddoing it manually
I just did a search for the first non-space non-paragraph mark and
messagethis 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
news:A10E3648-7239-4F4A-B280-76712D9AACA2@xxxxxxxxxxxxxxxx
How can I remove all spaces (lines) aka? Hard-returns at the top
editing apage
in
my document, is there a macro I can do this with.
It should be something to write as "clean-up-process" after
result indoc,
since any editing would move text around again and obviously
orsome
spaces at the top of a doc.
I tried to look for some examples but most removes all line breaks
theseshard-returns, I am looking only for something that will find
linespaces
(breaks) at the top of the page and remove them up to the first
of
text
on that page.
Hope this makes sense
- Follow-Ups:
- Re: Remove spaces (Hard-returns) at top of pages
- From: Tony Jollans
- Re: Remove spaces (Hard-returns) at top of pages
- References:
- Re: Remove spaces (Hard-returns) at top of pages
- From: Tony Jollans
- Re: Remove spaces (Hard-returns) at top of pages
- From: Ant(antonfh_at_gmail_dot_com)
- Re: Remove spaces (Hard-returns) at top of pages
- From: Tony Jollans
- Re: Remove spaces (Hard-returns) at top of pages
- From: Ant(antonfh_at_gmail_dot_com)
- Re: Remove spaces (Hard-returns) at top of pages
- From: Tony Jollans
- Re: Remove spaces (Hard-returns) at top of pages
- Prev by Date: Re: Populating information from Locked form document
- Next by Date: Re: I want to delete the balnk page when I create an envelope
- Previous by thread: Re: Remove spaces (Hard-returns) at top of pages
- Next by thread: Re: Remove spaces (Hard-returns) at top of pages
- Index(es):
Relevant Pages
|