Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Tadwick Tadwick is offline
external usenet poster
 
Posts: 6
Default Find syntax for ignoring consecutive characters

Here's my problem: I want format all text inside single quotes as red but
ignore embedded quotes ie two consecutive quotes.

eg PRINT 'This is one of the discussion group''s threads started by ''Tad'''

ie Can you use [']{1} to somehow ignore the [']{1} occurences?

Thanks, Tad
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jean-Guy Marcil Jean-Guy Marcil is offline
external usenet poster
 
Posts: 67
Default Find syntax for ignoring consecutive characters

Tadwick was telling us:
Tadwick nous racontait que :

Here's my problem: I want format all text inside single quotes as red
but ignore embedded quotes ie two consecutive quotes.

eg PRINT 'This is one of the discussion group''s threads started by
''Tad'''

ie Can you use [']{1} to somehow ignore the [']{1} occurences?

Thanks, Tad


It is not entirely clear (to me) what you want to do, and your example even
has triple quotes...
Can you show us what you start with, and the result you want?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Tadwick Tadwick is offline
external usenet poster
 
Posts: 6
Default Find syntax for ignoring consecutive characters

Here's what I did in the meantime:

- replace double quotes with a temp string
- format the text within single quotes
- replace temp string with double quotes again

'format quoted text
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Font.Color = wdColorAutomatic
.Text = "''"
.Replacement.Text = "doublequote"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = ActiveDocument.Styles("Quoted Red")
With Selection.Find
.Font.Color = wdColorAutomatic
.Text = "'*'"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "doublequote"
.Replacement.Text = "''"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll


"Jean-Guy Marcil" wrote:

Tadwick was telling us:
Tadwick nous racontait que :

Here's my problem: I want format all text inside single quotes as red
but ignore embedded quotes ie two consecutive quotes.

eg PRINT 'This is one of the discussion group''s threads started by
''Tad'''

ie Can you use [']{1} to somehow ignore the [']{1} occurences?

Thanks, Tad


It is not entirely clear (to me) what you want to do, and your example even
has triple quotes...
Can you show us what you start with, and the result you want?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Jean-Guy Marcil Jean-Guy Marcil is offline
external usenet poster
 
Posts: 67
Default Find syntax for ignoring consecutive characters

Tadwick was telling us:
Tadwick nous racontait que :

Here's what I did in the meantime:

- replace double quotes with a temp string
- format the text within single quotes
- replace temp string with double quotes again


So... problem solved?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org


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 find and replace bullet symbols (not style)? 86Ranger Microsoft Word Help 14 March 20th 06 08:00 PM
How to use Find and Replace for Auto Correct entries & symbols Jeanette Microsoft Word Help 9 November 10th 05 10:14 AM
Weird characters (double question marks) in text Jan Fransen Microsoft Word Help 2 September 19th 05 05:17 PM
Where do I find Spanish characters for typing? Marina Microsoft Word Help 1 August 5th 05 03:31 AM
Find and Replace anomaly BruceM Microsoft Word Help 7 January 18th 05 05:47 PM


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