Can pages in MS word 7 be sorted ?

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!!!



TIMFOX123Asked:
Who is Participating?
 
Chris BottomleyConnect With a Mentor Software Quality Lead EngineerCommented:
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
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Do you have an example we can look at?
0
 
TIMFOX123Author Commented:
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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
TIMFOX123Author Commented:
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
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Without a representative file can you indicate if there is any font or layout information you want to maintain?

Chris
0
 
TIMFOX123Author Commented:
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
 
TIMFOX123Author Commented:
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
 
Chris BottomleySoftware Quality Lead EngineerCommented:
I'm still working on it ... have you given up?
0
 
TIMFOX123Author Commented:
I still want a better solution, chris I am going to try to reopen this !!  thank you !!!!
0
 
TIMFOX123Author Commented:
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
 
Chris BottomleySoftware Quality Lead EngineerCommented:
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
 
TIMFOX123Author Commented:
I just need to seperate "the wheat from the chaff"

The good from the bad.

thank you for working this so hard.  really
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
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
 
TIMFOX123Author Commented:
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
 
TIMFOX123Author Commented:
I just want to put in my own field

sneezy > down
bashfull > down

0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
>>> 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
 
TIMFOX123Author Commented:
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
 
Chris BottomleySoftware Quality Lead EngineerCommented:
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
 
TIMFOX123Author Commented:
Chris
what a great job.

thx

timfox123 !!
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
Glad it helped!

Chris
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.