Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Deleting group of white space and formating a paragraph
I need to format each paragraph indenting the 2nd line about 5 spaces so it
looks like this: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) There are many spaces of 'white space betwen the R1-39 and the end of the Paragraph mark. I would like to do this with Find & replace so I can Record a macro. Original data: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) SC-1000, SUB 12 - Order Giving Notice of Intent to Cancel PSP Certificate(Wired Communications) (04/11/2006) |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Deleting group of white space and formating a paragraph
Cas here again... What I tried to show did not stick... The second line
starting with Promulgating should be indented about 5 spaces. "Cas" wrote: I need to format each paragraph indenting the 2nd line about 5 spaces so it looks like this: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) There are many spaces of 'white space betwen the R1-39 and the end of the Paragraph mark. I would like to do this with Find & replace so I can Record a macro. Original data: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) SC-1000, SUB 12 - Order Giving Notice of Intent to Cancel PSP Certificate(Wired Communications) (04/11/2006) |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Deleting group of white space and formating a paragraph
Apply a hanging indent to the paragraph.
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Cas" wrote in message ... I need to format each paragraph indenting the 2nd line about 5 spaces so it looks like this: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) There are many spaces of 'white space betwen the R1-39 and the end of the Paragraph mark. I would like to do this with Find & replace so I can Record a macro. Original data: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) SC-1000, SUB 12 - Order Giving Notice of Intent to Cancel PSP Certificate(Wired Communications) (04/11/2006) |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Deleting group of white space and formating a paragraph
Then save that indentation as a style and apply it to the rest of the
paragraphs. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Apply a hanging indent to the paragraph. "Cas" wrote in message ... I need to format each paragraph indenting the 2nd line about 5 spaces so it looks like this: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) There are many spaces of 'white space betwen the R1-39 and the end of the Paragraph mark. I would like to do this with Find & replace so I can Record a macro. Original data: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) SC-1000, SUB 12 - Order Giving Notice of Intent to Cancel PSP Certificate(Wired Communications) (04/11/2006) |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Deleting group of white space and formating a paragraph
I know how to do it as you suggested. The document has about 1300 records
that all look like this. I need to use Find/Replace in a macro to do it automatically. I need to Find a paragraph that starts with some Alpha with a dash (X- or XX-) and highlight (select) that paragraph to the end of a Paragraph mark, then go into format and do what you suggested, ALL WITHIN A MACRO USING FIND/REPLACE. "Graham Mayor" wrote: Then save that indentation as a style and apply it to the rest of the paragraphs. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Apply a hanging indent to the paragraph. "Cas" wrote in message ... I need to format each paragraph indenting the 2nd line about 5 spaces so it looks like this: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) There are many spaces of 'white space betwen the R1-39 and the end of the Paragraph mark. I would like to do this with Find & replace so I can Record a macro. Original data: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) SC-1000, SUB 12 - Order Giving Notice of Intent to Cancel PSP Certificate(Wired Communications) (04/11/2006) |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Deleting group of white space and formating a paragraph
Well, you didn't say that in your original post. You can do this with
wildcards, and Graham will no doubt tell you exactly how. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Cas" wrote in message ... I know how to do it as you suggested. The document has about 1300 records that all look like this. I need to use Find/Replace in a macro to do it automatically. I need to Find a paragraph that starts with some Alpha with a dash (X- or XX-) and highlight (select) that paragraph to the end of a Paragraph mark, then go into format and do what you suggested, ALL WITHIN A MACRO USING FIND/REPLACE. "Graham Mayor" wrote: Then save that indentation as a style and apply it to the rest of the paragraphs. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Apply a hanging indent to the paragraph. "Cas" wrote in message ... I need to format each paragraph indenting the 2nd line about 5 spaces so it looks like this: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) There are many spaces of 'white space betwen the R1-39 and the end of the Paragraph mark. I would like to do this with Find & replace so I can Record a macro. Original data: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) SC-1000, SUB 12 - Order Giving Notice of Intent to Cancel PSP Certificate(Wired Communications) (04/11/2006) |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Deleting group of white space and formating a paragraph
Create the indented paragraph style then run the following macro. Pick the
style you have created from the list and it will apply that style to all paragraphs that begin with an uppercase letter or two followed by a hyphen. If you need to adjust the findtext string make the changes between the quotes. Sub AddAStyle() Dim ReplaceStyle As String Dim findText As String findText = "[A-Z]{1,2}-" With Dialogs(wdDialogFormatStyle) .Display ReplaceStyle = .Name End With Selection.HomeKey Unit:=wdStory Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting Selection.Find.Replacement.Style = _ ActiveDocument.Styles(ReplaceStyle) With Selection.Find .Text = findText .Replacement.Text = "^&" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = True .MatchWildcards = True .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Well, you didn't say that in your original post. You can do this with wildcards, and Graham will no doubt tell you exactly how. "Cas" wrote in message ... I know how to do it as you suggested. The document has about 1300 records that all look like this. I need to use Find/Replace in a macro to do it automatically. I need to Find a paragraph that starts with some Alpha with a dash (X- or XX-) and highlight (select) that paragraph to the end of a Paragraph mark, then go into format and do what you suggested, ALL WITHIN A MACRO USING FIND/REPLACE. "Graham Mayor" wrote: Then save that indentation as a style and apply it to the rest of the paragraphs. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Apply a hanging indent to the paragraph. "Cas" wrote in message ... I need to format each paragraph indenting the 2nd line about 5 spaces so it looks like this: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) There are many spaces of 'white space betwen the R1-39 and the end of the Paragraph mark. I would like to do this with Find & replace so I can Record a macro. Original data: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) SC-1000, SUB 12 - Order Giving Notice of Intent to Cancel PSP Certificate(Wired Communications) (04/11/2006) |
#8
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Deleting group of white space and formating a paragraph
But if the OP knows how to use Find and Replace, can't he just type
[A-Z]{1,2}- in the "Find what" box and select the desired style in the "Replace with" box (empty) and Replace All? -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Graham Mayor" wrote in message ... Create the indented paragraph style then run the following macro. Pick the style you have created from the list and it will apply that style to all paragraphs that begin with an uppercase letter or two followed by a hyphen. If you need to adjust the findtext string make the changes between the quotes. Sub AddAStyle() Dim ReplaceStyle As String Dim findText As String findText = "[A-Z]{1,2}-" With Dialogs(wdDialogFormatStyle) .Display ReplaceStyle = .Name End With Selection.HomeKey Unit:=wdStory Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting Selection.Find.Replacement.Style = _ ActiveDocument.Styles(ReplaceStyle) With Selection.Find .Text = findText .Replacement.Text = "^&" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = True .MatchWildcards = True .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Well, you didn't say that in your original post. You can do this with wildcards, and Graham will no doubt tell you exactly how. "Cas" wrote in message ... I know how to do it as you suggested. The document has about 1300 records that all look like this. I need to use Find/Replace in a macro to do it automatically. I need to Find a paragraph that starts with some Alpha with a dash (X- or XX-) and highlight (select) that paragraph to the end of a Paragraph mark, then go into format and do what you suggested, ALL WITHIN A MACRO USING FIND/REPLACE. "Graham Mayor" wrote: Then save that indentation as a style and apply it to the rest of the paragraphs. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Apply a hanging indent to the paragraph. "Cas" wrote in message ... I need to format each paragraph indenting the 2nd line about 5 spaces so it looks like this: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) There are many spaces of 'white space betwen the R1-39 and the end of the Paragraph mark. I would like to do this with Find & replace so I can Record a macro. Original data: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) SC-1000, SUB 12 - Order Giving Notice of Intent to Cancel PSP Certificate(Wired Communications) (04/11/2006) |
#9
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Deleting group of white space and formating a paragraph
That would work
But the OP asked for a replace function for use in a macro. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: But if the OP knows how to use Find and Replace, can't he just type [A-Z]{1,2}- in the "Find what" box and select the desired style in the "Replace with" box (empty) and Replace All? "Graham Mayor" wrote in message ... Create the indented paragraph style then run the following macro. Pick the style you have created from the list and it will apply that style to all paragraphs that begin with an uppercase letter or two followed by a hyphen. If you need to adjust the findtext string make the changes between the quotes. Sub AddAStyle() Dim ReplaceStyle As String Dim findText As String findText = "[A-Z]{1,2}-" With Dialogs(wdDialogFormatStyle) .Display ReplaceStyle = .Name End With Selection.HomeKey Unit:=wdStory Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting Selection.Find.Replacement.Style = _ ActiveDocument.Styles(ReplaceStyle) With Selection.Find .Text = findText .Replacement.Text = "^&" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = True .MatchWildcards = True .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Well, you didn't say that in your original post. You can do this with wildcards, and Graham will no doubt tell you exactly how. "Cas" wrote in message ... I know how to do it as you suggested. The document has about 1300 records that all look like this. I need to use Find/Replace in a macro to do it automatically. I need to Find a paragraph that starts with some Alpha with a dash (X- or XX-) and highlight (select) that paragraph to the end of a Paragraph mark, then go into format and do what you suggested, ALL WITHIN A MACRO USING FIND/REPLACE. "Graham Mayor" wrote: Then save that indentation as a style and apply it to the rest of the paragraphs. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Apply a hanging indent to the paragraph. "Cas" wrote in message ... I need to format each paragraph indenting the 2nd line about 5 spaces so it looks like this: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) There are many spaces of 'white space betwen the R1-39 and the end of the Paragraph mark. I would like to do this with Find & replace so I can Record a macro. Original data: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) SC-1000, SUB 12 - Order Giving Notice of Intent to Cancel PSP Certificate(Wired Communications) (04/11/2006) |
#10
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Deleting group of white space and formating a paragraph
Thanks for all your help.
I got what I needed to work. Cas "Graham Mayor" wrote: That would work But the OP asked for a replace function for use in a macro. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: But if the OP knows how to use Find and Replace, can't he just type [A-Z]{1,2}- in the "Find what" box and select the desired style in the "Replace with" box (empty) and Replace All? "Graham Mayor" wrote in message ... Create the indented paragraph style then run the following macro. Pick the style you have created from the list and it will apply that style to all paragraphs that begin with an uppercase letter or two followed by a hyphen. If you need to adjust the findtext string make the changes between the quotes. Sub AddAStyle() Dim ReplaceStyle As String Dim findText As String findText = "[A-Z]{1,2}-" With Dialogs(wdDialogFormatStyle) .Display ReplaceStyle = .Name End With Selection.HomeKey Unit:=wdStory Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting Selection.Find.Replacement.Style = _ ActiveDocument.Styles(ReplaceStyle) With Selection.Find .Text = findText .Replacement.Text = "^&" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = True .MatchWildcards = True .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Well, you didn't say that in your original post. You can do this with wildcards, and Graham will no doubt tell you exactly how. "Cas" wrote in message ... I know how to do it as you suggested. The document has about 1300 records that all look like this. I need to use Find/Replace in a macro to do it automatically. I need to Find a paragraph that starts with some Alpha with a dash (X- or XX-) and highlight (select) that paragraph to the end of a Paragraph mark, then go into format and do what you suggested, ALL WITHIN A MACRO USING FIND/REPLACE. "Graham Mayor" wrote: Then save that indentation as a style and apply it to the rest of the paragraphs. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Apply a hanging indent to the paragraph. "Cas" wrote in message ... I need to format each paragraph indenting the 2nd line about 5 spaces so it looks like this: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) There are many spaces of 'white space betwen the R1-39 and the end of the Paragraph mark. I would like to do this with Find & replace so I can Record a macro. Original data: M-100, SUB 133 - Order Amending Rules R1-5(g), R1-7(c), and R1-21(c) and Promulgating Rule R1-39 (02/02/2006) SC-1000, SUB 12 - Order Giving Notice of Intent to Cancel PSP Certificate(Wired Communications) (04/11/2006) |