Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Julian
 
Posts: n/a
Default Replace/Erase substring of a word

Hi
I am trying to find words with bold format and delete the substring [0,5] of
all occurences
All words are longer then 5 letters.
I am able to find the words with the format but I cannot delete the substing.
Is it possible to type something like [6]* in the replace field to keep the
letter 6 and higher in the word?
Any suggestions?


  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey
 
Posts: n/a
Default Replace/Erase substring of a word

Try

MoreUse Wildcards

Find: ?{5}(*)
Replace with \1

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Hi
I am trying to find words with bold format and delete the substring
[0,5] of all occurences
All words are longer then 5 letters.
I am able to find the words with the format but I cannot delete the
substing. Is it possible to type something like [6]* in the replace
field to keep the letter 6 and higher in the word?
Any suggestions?



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Julian
 
Posts: n/a
Default Replace/Erase substring of a word

Thanks Greg
I did as you mentioned but it did not work.

I tried to search
?{5}(*)

and replace it with
\1




"Greg Maxey" wrote:

Try

MoreUse Wildcards

Find: ?{5}(*)
Replace with \1

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Hi
I am trying to find words with bold format and delete the substring
[0,5] of all occurences
All words are longer then 5 letters.
I am able to find the words with the format but I cannot delete the
substing. Is it possible to type something like [6]* in the replace
field to keep the letter 6 and higher in the word?
Any suggestions?




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey
 
Posts: n/a
Default Replace/Erase substring of a word

Did you set the format in the find field to "Bold."

It should work if I understand your objective. Find words in bold and
delete first five characters.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Thanks Greg
I did as you mentioned but it did not work.

I tried to search
?{5}(*)

and replace it with
\1




"Greg Maxey" wrote:

Try

MoreUse Wildcards

Find: ?{5}(*)
Replace with \1

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Hi
I am trying to find words with bold format and delete the substring
[0,5] of all occurences
All words are longer then 5 letters.
I am able to find the words with the format but I cannot delete the
substing. Is it possible to type something like [6]* in the replace
field to keep the letter 6 and higher in the word?
Any suggestions?



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Julian
 
Posts: n/a
Default Replace/Erase substring of a word

Yes I did as you mentioned.
Even though if I did not change the Find field to bold it should have
deleted the first five characters of words with normal format?



"Greg Maxey" wrote:

Did you set the format in the find field to "Bold."

It should work if I understand your objective. Find words in bold and
delete first five characters.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Thanks Greg
I did as you mentioned but it did not work.

I tried to search
?{5}(*)

and replace it with
\1




"Greg Maxey" wrote:

Try

MoreUse Wildcards

Find: ?{5}(*)
Replace with \1

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Hi
I am trying to find words with bold format and delete the substring
[0,5] of all occurences
All words are longer then 5 letters.
I am able to find the words with the format but I cannot delete the
substing. Is it possible to type something like [6]* in the replace
field to keep the letter 6 and higher in the word?
Any suggestions?






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey
 
Posts: n/a
Default Replace/Erase substring of a word

Julian,

Hmm,,try Find: *{4}(*)
Replace: \1

If this doesn't work, show me an example of what should be found and what it
should look like afterwards.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Yes I did as you mentioned.
Even though if I did not change the Find field to bold it should have
deleted the first five characters of words with normal format?



"Greg Maxey" wrote:

Did you set the format in the find field to "Bold."

It should work if I understand your objective. Find words in bold
and delete first five characters.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Thanks Greg
I did as you mentioned but it did not work.

I tried to search
?{5}(*)

and replace it with
\1




"Greg Maxey" wrote:

Try

MoreUse Wildcards

Find: ?{5}(*)
Replace with \1

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Hi
I am trying to find words with bold format and delete the
substring [0,5] of all occurences
All words are longer then 5 letters.
I am able to find the words with the format but I cannot delete
the substing. Is it possible to type something like [6]* in the
replace field to keep the letter 6 and higher in the word?
Any suggestions?



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Julian
 
Posts: n/a
Default Replace/Erase substring of a word

Hi

Example 1
Word without format
Word befo stronger
Word after: er

Example2
A whole line with bold format
Line befo My name is Julian
Line after: me is Julian

Is the expression
*{4}(*)
going to mark the first 4 characters in every word in the text even when you
use the expression just for searching words?

"Greg Maxey" wrote:

Julian,

Hmm,,try Find: *{4}(*)
Replace: \1

If this doesn't work, show me an example of what should be found and what it
should look like afterwards.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Yes I did as you mentioned.
Even though if I did not change the Find field to bold it should have
deleted the first five characters of words with normal format?



"Greg Maxey" wrote:

Did you set the format in the find field to "Bold."

It should work if I understand your objective. Find words in bold
and delete first five characters.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Thanks Greg
I did as you mentioned but it did not work.

I tried to search
?{5}(*)

and replace it with
\1




"Greg Maxey" wrote:

Try

MoreUse Wildcards

Find: ?{5}(*)
Replace with \1

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Hi
I am trying to find words with bold format and delete the
substring [0,5] of all occurences
All words are longer then 5 letters.
I am able to find the words with the format but I cannot delete
the substing. Is it possible to type something like [6]* in the
replace field to keep the letter 6 and higher in the word?
Any suggestions?




  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey
 
Posts: n/a
Default Replace/Erase substring of a word

Julian,

You are changing the rules in the middle of the game ;-)

You said nothing about whole lines in your original post or about changing
non-bolded text.

The last code I sent you would convert

Stronger stronger stronger stronger

to: "stronger er stronger er" if the second and fouth words where
formatted to bold.

If you want the "find" isolated to "bold" text only, then you have to put
the cursor in the find field and press Moreformatfontbold.





--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Hi

Example 1
Word without format
Word befo stronger
Word after: er

Example2
A whole line with bold format
Line befo My name is Julian
Line after: me is Julian

Is the expression
*{4}(*)
going to mark the first 4 characters in every word in the text even
when you use the expression just for searching words?

"Greg Maxey" wrote:

Julian,

Hmm,,try Find: *{4}(*)
Replace: \1

If this doesn't work, show me an example of what should be found and
what it should look like afterwards.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Yes I did as you mentioned.
Even though if I did not change the Find field to bold it should
have deleted the first five characters of words with normal format?



"Greg Maxey" wrote:

Did you set the format in the find field to "Bold."

It should work if I understand your objective. Find words in bold
and delete first five characters.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Thanks Greg
I did as you mentioned but it did not work.

I tried to search
?{5}(*)

and replace it with
\1




"Greg Maxey" wrote:

Try

MoreUse Wildcards

Find: ?{5}(*)
Replace with \1

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Hi
I am trying to find words with bold format and delete the
substring [0,5] of all occurences
All words are longer then 5 letters.
I am able to find the words with the format but I cannot delete
the substing. Is it possible to type something like [6]* in the
replace field to keep the letter 6 and higher in the word?
Any suggestions?



  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Julian
 
Posts: n/a
Default Replace/Erase substring of a word

Hi Greg
I will tell you the whole story now.

I have a big document which has several heading levels
Heading1, Heading2, Heading3

The Headings are numbered manually which means that if you add or delete a
heading the correct heading number will not be updated.
What I want to do is to delete all the manually added numbers in the
beginning of each heading and add automatic numbering format.
The only problem is how to delete the numbers which each heading starts with.

Example1
heading3 befo 1.2.2 Technical specification
heading3 after: Technical specification













"Greg Maxey" wrote:

Julian,

You are changing the rules in the middle of the game ;-)

You said nothing about whole lines in your original post or about changing
non-bolded text.

The last code I sent you would convert

Stronger stronger stronger stronger

to: "stronger er stronger er" if the second and fouth words where
formatted to bold.

If you want the "find" isolated to "bold" text only, then you have to put
the cursor in the find field and press Moreformatfontbold.





--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Hi

Example 1
Word without format
Word befo stronger
Word after: er

Example2
A whole line with bold format
Line befo My name is Julian
Line after: me is Julian

Is the expression
*{4}(*)
going to mark the first 4 characters in every word in the text even
when you use the expression just for searching words?

"Greg Maxey" wrote:

Julian,

Hmm,,try Find: *{4}(*)
Replace: \1

If this doesn't work, show me an example of what should be found and
what it should look like afterwards.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Yes I did as you mentioned.
Even though if I did not change the Find field to bold it should
have deleted the first five characters of words with normal format?



"Greg Maxey" wrote:

Did you set the format in the find field to "Bold."

It should work if I understand your objective. Find words in bold
and delete first five characters.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Thanks Greg
I did as you mentioned but it did not work.

I tried to search
?{5}(*)

and replace it with
\1




"Greg Maxey" wrote:

Try

MoreUse Wildcards

Find: ?{5}(*)
Replace with \1

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Julian wrote:
Hi
I am trying to find words with bold format and delete the
substring [0,5] of all occurences
All words are longer then 5 letters.
I am able to find the words with the format but I cannot delete
the substing. Is it possible to type something like [6]* in the
replace field to keep the letter 6 and higher in the word?
Any suggestions?




  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Greg
 
Posts: n/a
Default Replace/Erase substring of a word

Try this ;-)

Sub Test()
Dim oPar As Paragraph
Dim myRng As Range
For Each oPar In ActiveDocument.Paragraphs
Select Case oPar.Style
Case "Heading 1", "Heading 2", "Heading 3"
Set myRng = oPar.Range.Duplicate
myRng.Collapse wdCollapseStart
myRng.MoveEndUntil Cset:="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
myRng.MoveEnd wdCharacter, -1
myRng.Delete
Case Else
'Do Nothing
End Select
Next oPar
End Sub

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
Fill-in field prompts Deb McLellan New Users 7 March 13th 06 08:43 PM
WP merge file to Word sstires Tables 4 February 14th 06 06:26 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
Does Word have a QuickCorrect/Quick Word option like WordPerfect? CW New Users 2 December 20th 05 05:54 PM
In Word, how do I surpress headers and footers on page 2 Bill Microsoft Word Help 1 December 15th 05 06:13 PM


All times are GMT +1. The time now is 07:38 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"