Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sort Pages (97 SR2)

    It seems simple in concept, but implementing it is a whole other matter.

    I want to sort the pages in my word document by the first letter on the page. Any ideas?
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sort Pages (97 SR2)

    If you can encapsulate the contents of each page somehow, you might be able to do it fairly easily. For example, you might try putting the contents of each page into a single cell of a large table (one with cells large enough such that each cell is actually as big as the normal page margins). Then I think you could sort the table, which would treat the first letter as the most-significant whatchamacallit.

    If that is not feasible, you might consider a macro that rummages through the document, build a list of the new order, then copies each of the pages into a new document. When it is done, it could clear the contents of the original and paste the new document contents back in. However, be careful; if you move the current page 2 in front of the current page 1, the automatic pagination may put the page break for page 2 somewhere before or after the original beginning of page 1, because of various style settings, paragraph lengths, etc.. This effect might be avoided by using hard page breaks at a high enough frequency that there are no soft breaks in the document.

    These are just ideas. You are correct, it is not very simple or straightforward implemenation!

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sort Pages (97 SR2)

    We tried all these, ideally it would be VB or otherwise, to automate the process...
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Sort Pages (97 SR2)

    Hi,

    If you ask the question about sorting pages, I would almost have to assume that each page would be it's own "entity". That is, there'd be a manual page break at the end of the page.

    If that is so, then here's a wierd approach. (If not, then you run into the repagination problems mentioned in the other response.) But I tested it and it works. My example may be trivial so you might have to play with it a little, but not too much. I think you can probably figure it out from the approach below.
    1. Make sure there is a pagebreak after the last page.
    2. Select the entire text. Use F/R and replace all paragraph marks with something like xxx. So each page is 1 big paragraph.
    3. Select the entire text. Use F/R with wildcards checked and replace all manual pagebreaks (hence the assumption above) with something like yyy^013. The yyy part can be whatever you want but the ^013 is a paragraph mark (word doesn't have paragraph mark in the wildcard replace).

    When done, you should have something like
    Atextxxxtextyyy^013 [again, ^013 will be a para mark]
    Ctextxxxtextxxxtextyyy^013
    Btextyyy^013

    where I've used A,B,C as the arbitrary first letters on each page.

    Select this all and copy to the clipboard.

    Go into Excel. Position the cursor on cell A1. Paste. Now sort.

    The reason for replacing the para marks was because excel treats each para as a new cell - not what you want.

    Now select your cells in col A for as many rows as you have. Copy to clipboard.

    Back to word.

    1.Paste (probably into a new doc).
    2. This will come in as a table. Convert table to text and use a para mark to delimit.
    3. reverse the process of F/R to restore para marks and page breaks.

    Voila. And isn't this a Rube Goldberg approach?

    fred

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Sort Pages (97 SR2)

    Hi,

    I had one of those moments last night and it was late. So overlooked the obvious.

    Once you have your pages converted into single paragraphs (which is what the first part of the solution did), you can sort the paragraphs in Word. Then pick up with the solution as posted to just recreate the original paragraphs and pages.

    Fred

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •