Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I find and replace bullet symbols (not style)? | Microsoft Word Help | |||
How to use Find and Replace for Auto Correct entries & symbols | Microsoft Word Help | |||
Weird characters (double question marks) in text | Microsoft Word Help | |||
Where do I find Spanish characters for typing? | Microsoft Word Help | |||
Find and Replace anomaly | Microsoft Word Help |