Solved

Can pages in MS word 7 be sorted ?

Posted on 2011-03-02
20
221 Views
Last Modified: 2012-06-21
create a page with hostnames.  

I put manual page breaks between host names so it is one system per host name.

Now when I get  them done  half of them are status: waiting on approval

Can I do anyting to sort the ones that I can fix and put them at the top, the others would go at the bottom ?

I know this is a job for excel  

I realy do get a page of notes on each machine.  

I can not use excel for this because our machines are locked down to show all pages in excell on top of each other.  trying to compare 2 sheets is a pain!!!



0
Comment
Question by:TIMFOX123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 9
20 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35021008
Do you have an example we can look at?
0
 

Author Comment

by:TIMFOX123
ID: 35021260
one page for server named bart
results of ps -ef
Manual page break inserted into MS word

 one page for server lisa
results of ps -ef
Manual page break inserted into MS word



one page for server Homer
results of ps -ef
Manual page break inserted into MS word


0
 

Author Comment

by:TIMFOX123
ID: 35021425
Is there a way I can use document map to do this ?

I just want to get my hands on the servers I still need to fix easly.

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35021433
Without a representative file can you indicate if there is any font or layout information you want to maintain?

Chris
0
 

Author Comment

by:TIMFOX123
ID: 35021619
Actually I have something that works for me.

I can put headings <H1> on all the pages that I can fix and then "view document map "

this sorts out what I can fix :)  
0
 

Author Comment

by:TIMFOX123
ID: 35021642
I really could not post my sheet.  I work in a secure environment.   Sorry.  

thank you for trying however I did not give you enough :(  
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35021676
I'm still working on it ... have you given up?
0
 

Author Comment

by:TIMFOX123
ID: 35027848
I still want a better solution, chris I am going to try to reopen this !!  thank you !!!!
0
 

Author Comment

by:TIMFOX123
ID: 35027861
I use this all the time, that is why I want to find the stuff I can fix in a series of pages of stuff I can not fix  !!!  thx Chris
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35028868
Apart from seperating by status I assume there is no order of the servers needed in the output and if so what/how is the server status recorded on each page and which 'entries' go at the top and which at the bottom?

Chris
0
 

Author Comment

by:TIMFOX123
ID: 35030228
I just need to seperate "the wheat from the chaff"

The good from the bad.

thank you for working this so hard.  really
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35030374
Not helping ;o)  Take for example the 'sample' you posted:


one page for server named bart
results of ps -ef
Manual page break inserted into MS word

 one page for server lisa
results of ps -ef
Manual page break inserted into MS word



one page for server Homer
results of ps -ef
Manual page break inserted into MS word

How do I know which is good and which bad ... are there key phrases in the page which denote the classification?

Chris
0
 

Author Comment

by:TIMFOX123
ID: 35031160
Chris;

OK, lets say we have 7 servers named after the 7 dwarfs

Sneezy is broken due to a virus.
Bashfull will not respond to a ping.

I want to be able to seperate the servers I can fit from the other 5 which are running fine.

Dave
0
 

Author Comment

by:TIMFOX123
ID: 35031164
I just want to put in my own field

sneezy > down
bashfull > down

0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35031302
>>> sneezy > down
>>> bashfull > down

Now we're getting somewhere.  There will be a line for each server that says up/down or somesuch.  If the format is fixed and ideally the line then it will be possible to evaluate the status without too much difficulty.

Would you lke to settle on a format for example as stated already:

Sneezy > UP
bashfull > Down

And that the structure will be in effect unique to each record?

Chris
0
 

Author Comment

by:TIMFOX123
ID: 35061495
Chris

as you have it is just fine with me.

It is just someting for me so I can wade though all the data I have.  

0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35066416
Each time there is a break in the flow the question goes out of my mind ... so it'll be a few hours till I refresh myself on where I got to but if I do not post in the next 24 hours by all means give me a nudge.

Chris
0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 35066842
OKay, I found the work document so:

The following code takes a document as:

one page for server named bart
Bart > DOWn
results of ps –ef

==================

one page for server named Bartholomew
Bartholomew > up
results of ps -ef
===================
one page for server lisa
LISA > DoWn
results of ps -ef

And reorganises as down at the top and up at the bottom.  Note I delivberately confused the sense of up/down to work irrespective of case.  The key string for the decision is the string:

" > DOWN"

If found then the page moves to the top and all others are placed at the end.

Chris
Sub reorder()
Dim arr() As String
Dim arrTop() As String
Dim arrBottom() As String
Dim pg As Integer
Dim intArrayIndex As Integer
Dim intArrayIndexTop As Integer
Dim intArrayIndexBottom As Integer

    arr = Split(ThisDocument.Range, Chr(12))
    ThisDocument.Range.Delete
    For Each itm In arr
        If InStr(1, itm, " > DOWN", vbTextCompare) Then
            ReDim Preserve arrTop(intArrayIndexTop)
            arrTop(intArrayIndexTop) = itm
            intArrayIndexTop = intArrayIndexTop + 1
        Else
            ReDim Preserve arrBottom(intArrayIndexBottom)
            arrBottom(intArrayIndexBottom) = itm
            intArrayIndexBottom = intArrayIndexBottom + 1
        End If
        intarryindex = intArrayIndex + 1
    Next
    For pg = 1 To UBound(arrTop) + 1
        ThisDocument.Range.Collapse wdCollapseEnd
        Selection.TypeText arrTop(pg - 1) & Chr(12)
        Selection.GoTo What:=wdGoToPage, Which:=lNextPage
    Next
    ThisDocument.Range.Collapse wdCollapseEnd
'    Selection.TypeBackspace
    For pg = 1 To UBound(arrBottom) + 1
        ThisDocument.Range.Collapse wdCollapseEnd
        Selection.TypeText arrBottom(pg - 1) & Chr(12)
        Selection.GoTo What:=wdGoToPage, Which:=lNextPage
    Next
    ThisDocument.Range.Collapse wdCollapseEnd
    Selection.TypeBackspace
    
End Sub

Open in new window

0
 

Author Closing Comment

by:TIMFOX123
ID: 35073211
Chris
what a great job.

thx

timfox123 !!
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35073281
Glad it helped!

Chris
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you how to use shortcut menus in the Access run-time environment.
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question