Finding and Replacing areas in a MS Word document...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm sure this can be done. I just need help discovering how.

I have this MS Word document filled with a list of medical journals and
abstracts. The information contained is in this format:

1: NAME OF JOURNAL YEAR

DISCRIPTION OF JOURNAL

NAME OF AUTHOR, OTHER NAMES, OTHER NAMES, ... ...

THE DEPARTMENT IT CAME FROM <Department of...>

BACKGROUND STATEMENT

PMID NUMBER OF THIS PARTICULAR JOURNAL [PubMed - in process]

2. NAME OF JOURNAL YEAR .. ... .. ... (and it continues on until the end)

I have documents with 200+ pages of information I don't need but it would
take too long to go through and pick each AREA I don't need and delete them.

If you look at the first entry, I need to delete "THE DEPARTMENT IT CAME
FROM" information all the way to the "]" character in "[PubMed - in
process]".

But I have over 200 entries in 5 other documents that I need to look in and
search for this information I don't need.

Can anyone point me into the right place or tell me how to do this
step-by-step? It would help me out a lot.

Thanks in advance!

Leonard W. Peacock
 
Edit>Replace>More Use wildcards.

Type: THE DEPARTMENT*in process\] in the find what field
Leave the replace with field blank
Replace all.

Make a copy of your document first in case something goes screwy.
 
Leonard --

Using the Find / Replace with more wild cards if you can get it to work is
definitely the more elegant solution, no question.

I don't happen to know everything thing that needs to be done in that route,
so if you're also looking for perhaps an un-elegant solution, I have one as
well. Depending on exactly what you're looking for in those 200+ entries /
pages, this may end up suiting you for it, and maybe not.

However, to accomplish the first one, I put the cursor at the beginning of
"THE DEPARTMENT...", and then I started recording a macro, and here are the
keystrokes I took:
F8 [to start the selection of text]
ctrl-F [to bring up the search menu]
I entered, without the quotes, "]" in the search window
I then clicked on "Find Next", which brought the cursor to the "]"
--> It also highlighted everything that needed to be deleted, because I had
pressed F8 before doing the find.

If it's always going to be "The Department", then I would have just added a
find for that, without the highlighting.

Anyway, that's something you can run... it will basically always delete from
where the cursor is to where the next "]" is. Like I said, not elegant.

So, if you don't mind just hitting a keyboard key to run the macro a few
hundred times, which really won't take that long, this may work, clunky as it
is.



If you want to see what my macro looked like, this is how it appeared:
[and if you have any questions about it, give me a shout]

Sub testDeleteForLWP()
'
' testDeleteForLWP Macro
'
'
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=5
End Sub










Leonard W. Peacock said:
I'm sure this can be done. I just need help discovering how.

I have this MS Word document filled with a list of medical journals and
abstracts. The information contained is in this format:

1: NAME OF JOURNAL YEAR

DISCRIPTION OF JOURNAL

NAME OF AUTHOR, OTHER NAMES, OTHER NAMES, ... ...

THE DEPARTMENT IT CAME FROM <Department of...>

BACKGROUND STATEMENT

PMID NUMBER OF THIS PARTICULAR JOURNAL [PubMed - in process]

2. NAME OF JOURNAL YEAR .. ... .. ... (and it continues on until the end)

I have documents with 200+ pages of information I don't need but it would
take too long to go through and pick each AREA I don't need and delete them.

If you look at the first entry, I need to delete "THE DEPARTMENT IT CAME
FROM" information all the way to the "]" character in "[PubMed - in
process]".

But I have over 200 entries in 5 other documents that I need to look in and
search for this information I don't need.

Can anyone point me into the right place or tell me how to do this
step-by-step? It would help me out a lot.

Thanks in advance!

Leonard W. Peacock
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top