Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Steved
 
Posts: n/a
Default What is required to find two words please



[A-Za-z]@-[A-Za-z]@ will find CULLEN-SONET

What is required to find the below examples please.
DCASH-SKAI GLORY
GOLD BROSE-MOLINEUX
WOODBURY LAD-FASHION COURT
VOLKSRAAD-WALKIN ON SUNSH

Thankyou
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default What is required to find two words please

You can find the hyphenated words, but random phrases are impossible to
find - unless they are all known beforehand and you use an array eg.

Sub ReplaceList()
Dim vFindText As Variant
Dim vReplText As Variant
Dim i As Long
vFindText = Array("DCASH-SKAI GLORY", "GOLD BROSE-MOLINEUX", _
"WOODBURY LAD-FASHION COURT", "VOLKSRAAD-WALKIN ON SUNSH")
vReplText = Array("WORD1", "WORD2", "WORD3", "WORD4")
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = True
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText(i)
.Execute replace:=wdReplaceAll
Next i
End With
End Sub

Steved wrote:
[A-Za-z]@-[A-Za-z]@ will find CULLEN-SONET

What is required to find the below examples please.
DCASH-SKAI GLORY
GOLD BROSE-MOLINEUX
WOODBURY LAD-FASHION COURT
VOLKSRAAD-WALKIN ON SUNSH

Thankyou



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Steved
 
Posts: n/a
Default What is required to find two words please

Hello Graham from Steved

Thankyou

"Graham Mayor" wrote:

You can find the hyphenated words, but random phrases are impossible to
find - unless they are all known beforehand and you use an array eg.

Sub ReplaceList()
Dim vFindText As Variant
Dim vReplText As Variant
Dim i As Long
vFindText = Array("DCASH-SKAI GLORY", "GOLD BROSE-MOLINEUX", _
"WOODBURY LAD-FASHION COURT", "VOLKSRAAD-WALKIN ON SUNSH")
vReplText = Array("WORD1", "WORD2", "WORD3", "WORD4")
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = True
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText(i)
.Execute replace:=wdReplaceAll
Next i
End With
End Sub

Steved wrote:
[A-Za-z]@-[A-Za-z]@ will find CULLEN-SONET

What is required to find the below examples please.
DCASH-SKAI GLORY
GOLD BROSE-MOLINEUX
WOODBURY LAD-FASHION COURT
VOLKSRAAD-WALKIN ON SUNSH

Thankyou




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
Find multiple words JustLearning Microsoft Word Help 4 June 24th 05 03:27 PM
How do I build a word list with number of occurrences of each wor. Bill Crowl Microsoft Word Help 2 March 19th 05 11:17 PM
redundant words ambrozia Microsoft Word Help 1 March 10th 05 08:45 PM
How many times are words used in a document. Marker Microsoft Word Help 4 March 9th 05 04:55 AM
I am looking for Word's TOC and TOA Generator, where will I find t Cocostar Microsoft Word Help 1 January 12th 05 10:15 PM


All times are GMT +1. The time now is 03:39 AM.

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"