Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
jezzica85
 
Posts: n/a
Default Finding lines containing one word

Hi all,
Does anyone know if there's a way to use Find and Replace to find all the
lines in a document that only have one word on them?
Thanks!
Jezzica85
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jezebel
 
Posts: n/a
Default Finding lines containing one word

Assuming 'line' means paragraph and 'only one word' means that the paragraph
contains no spaces: with 'Use wildcards' checked --

Find: ^013[! ]@^013
Replace: ^pxxx^p

where xxx is your replacement text. Note that this won't do the very first
paragraph of the document.



"jezzica85" wrote in message
...
Hi all,
Does anyone know if there's a way to use Find and Replace to find all the
lines in a document that only have one word on them?
Thanks!
Jezzica85



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
jezzica85
 
Posts: n/a
Default Finding lines containing one word

Thank you Jezebel, but it looks like I wasn't clear enough with my question.
What I'm looking for is:

if I had a sentence like
this

"or a sentence like this that just overflowed naturally with dialogue like
this--"

Would there be a way to just scan a document for the "this's," basically
just a single word in a line, but not necessarily the start of a paragraph?
Thanks!

"Jezebel" wrote:

Assuming 'line' means paragraph and 'only one word' means that the paragraph
contains no spaces: with 'Use wildcards' checked --

Find: ^013[! ]@^013
Replace: ^pxxx^p

where xxx is your replacement text. Note that this won't do the very first
paragraph of the document.



"jezzica85" wrote in message
...
Hi all,
Does anyone know if there's a way to use Find and Replace to find all the
lines in a document that only have one word on them?
Thanks!
Jezzica85




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Jezebel
 
Posts: n/a
Default Finding lines containing one word

That's a much harder task. I can think of several ways to do it, but only
with a fair amount of tricky macro programming. What are you actually trying
to achieve?



"jezzica85" wrote in message
...
Thank you Jezebel, but it looks like I wasn't clear enough with my
question.
What I'm looking for is:

if I had a sentence like
this

"or a sentence like this that just overflowed naturally with dialogue like
this--"

Would there be a way to just scan a document for the "this's," basically
just a single word in a line, but not necessarily the start of a
paragraph?
Thanks!

"Jezebel" wrote:

Assuming 'line' means paragraph and 'only one word' means that the
paragraph
contains no spaces: with 'Use wildcards' checked --

Find: ^013[! ]@^013
Replace: ^pxxx^p

where xxx is your replacement text. Note that this won't do the very
first
paragraph of the document.



"jezzica85" wrote in message
...
Hi all,
Does anyone know if there's a way to use Find and Replace to find all
the
lines in a document that only have one word on them?
Thanks!
Jezzica85






  #5   Report Post  
Posted to microsoft.public.word.docmanagement
jezzica85
 
Posts: n/a
Default Finding lines containing one word

All I'm trying to do is go through a document just to see how many times that
happens, it's more of a weird trivia-ish thing, not really for any real
purpose except so I know in case I want to print the document later.

"Jezebel" wrote:

That's a much harder task. I can think of several ways to do it, but only
with a fair amount of tricky macro programming. What are you actually trying
to achieve?



"jezzica85" wrote in message
...
Thank you Jezebel, but it looks like I wasn't clear enough with my
question.
What I'm looking for is:

if I had a sentence like
this

"or a sentence like this that just overflowed naturally with dialogue like
this--"

Would there be a way to just scan a document for the "this's," basically
just a single word in a line, but not necessarily the start of a
paragraph?
Thanks!

"Jezebel" wrote:

Assuming 'line' means paragraph and 'only one word' means that the
paragraph
contains no spaces: with 'Use wildcards' checked --

Find: ^013[! ]@^013
Replace: ^pxxx^p

where xxx is your replacement text. Note that this won't do the very
first
paragraph of the document.



"jezzica85" wrote in message
...
Hi all,
Does anyone know if there's a way to use Find and Replace to find all
the
lines in a document that only have one word on them?
Thanks!
Jezzica85








  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Jezebel
 
Posts: n/a
Default Finding lines containing one word

Here's some code that you might be able to adapt --

Dim pPar As Word.Paragraph
Dim pRange As Word.Range

For Each pPar In ActiveDocument.Paragraphs
Set pRange = ActiveDocument.Range(pPar.Range.End - 1,
pPar.Range.End)
If pRange.Information(wdHorizontalPositionRelativeToP age) x Then
...
End If
Next

This checks the horizontal position of the end-of-paragraph, and does
something if the last line of the paragraph is less than some value. Not
quite what you're asking, but maybe sufficient. You'll need to insert a
value for x (in points) that's your threshhold of interest (ie, do something
if the last line is shorter than this value). And you'll need to insert
whatever you actually want to have happen, eg select the line and stop, or
format the last word in some way that you can then use with Find.



"jezzica85" wrote in message
...
All I'm trying to do is go through a document just to see how many times
that
happens, it's more of a weird trivia-ish thing, not really for any real
purpose except so I know in case I want to print the document later.

"Jezebel" wrote:

That's a much harder task. I can think of several ways to do it, but only
with a fair amount of tricky macro programming. What are you actually
trying
to achieve?



"jezzica85" wrote in message
...
Thank you Jezebel, but it looks like I wasn't clear enough with my
question.
What I'm looking for is:

if I had a sentence like
this

"or a sentence like this that just overflowed naturally with dialogue
like
this--"

Would there be a way to just scan a document for the "this's,"
basically
just a single word in a line, but not necessarily the start of a
paragraph?
Thanks!

"Jezebel" wrote:

Assuming 'line' means paragraph and 'only one word' means that the
paragraph
contains no spaces: with 'Use wildcards' checked --

Find: ^013[! ]@^013
Replace: ^pxxx^p

where xxx is your replacement text. Note that this won't do the very
first
paragraph of the document.



"jezzica85" wrote in message
...
Hi all,
Does anyone know if there's a way to use Find and Replace to find
all
the
lines in a document that only have one word on them?
Thanks!
Jezzica85








Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I "reveal codes" in Word the way I could in Word Perfect? crystal Microsoft Word Help 3 May 11th 06 02:10 AM
hard space between words. Sandy L Microsoft Word Help 7 May 5th 06 08:25 PM
Compare Word to Wordperfect? Joe Santora Microsoft Word Help 1 April 13th 06 05:16 PM
Word should allow to 'divide' page by 3 or 4, not just 2 CandasK Page Layout 2 February 28th 06 10:16 PM
How can Word display full path of a file in the title bar? SAsif Microsoft Word Help 1 January 26th 06 04:32 PM


All times are GMT +1. The time now is 05:44 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"