Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Can any one give me macro syntax to do the following:
1. To insert 2 spaces after every full stop or end of sentence or end of paragraph(just before para return sign) 2. The above should work for text in Tables also. Thanks in advance. |
#2
![]() |
|||
|
|||
![]()
Try something like:
Public Sub Scratch Macro() Dim rngStory As Word.Range ' Fix the skipped blank Header/Footer problem MakeHFValid ' Iterate through all story types in the current document For Each rngStory In ActiveDocument.StoryRanges ' Iterate through all linked stories Do Until (rngStory Is Nothing) With rngStory.Find .ClearFormatting .Replacement.ClearFormatting .MatchWildcards = True .Text = "([:.,\!\?]) ([! ])": .Replacement.Text = "\1 \2" .Execute Replace:=wdReplaceAll End With Set rngStory = rngStory.NextStoryRange Loop Next End Sub Public Sub MakeHFValid() Dim lngJunk As Long lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype End Sub |
#3
![]() |
|||
|
|||
![]()
Greg:
Thanks once again! But this macro does not help me in end of paragraph returns. Regards Paresh "Greg" wrote: Try something like: Public Sub Scratch Macro() Dim rngStory As Word.Range ' Fix the skipped blank Header/Footer problem MakeHFValid ' Iterate through all story types in the current document For Each rngStory In ActiveDocument.StoryRanges ' Iterate through all linked stories Do Until (rngStory Is Nothing) With rngStory.Find .ClearFormatting .Replacement.ClearFormatting .MatchWildcards = True .Text = "([:.,\!\?]) ([! ])": .Replacement.Text = "\1 \2" .Execute Replace:=wdReplaceAll End With Set rngStory = rngStory.NextStoryRange Loop Next End Sub Public Sub MakeHFValid() Dim lngJunk As Long lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype End Sub |
#4
![]() |
|||
|
|||
![]()
Not sure I follow, but try:
Option Explicit Public Sub ScratchMacro() Dim rngStory As Word.Range ' Fix the skipped blank Header/Footer problem MakeHFValid ' Iterate through all story types in the current document For Each rngStory In ActiveDocument.StoryRanges ' Iterate through all linked stories Do Until (rngStory Is Nothing) With rngStory.Find .ClearFormatting .Replacement.ClearFormatting .MatchWildcards = True .Text = "([:.,\!\?\^13]) ([! ])": .Replacement.Text = "\1 \2" .Execute Replace:=wdReplaceAll .Text = "(?)(^13)" .Replacement.Text = "\1 \2" .Execute Replace:=wdReplaceAll End With Set rngStory = rngStory.NextStoryRange Loop Next End Sub Public Sub MakeHFValid() Dim lngJunk As Long lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype End Sub |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I display the full filepath on insert hyperlink in Word 200 | Microsoft Word Help | |||
Can I stop a picture from being copied after insert it into a Word | Microsoft Word Help | |||
How do I get Word to stop putting extra spaces after a period whe. | Microsoft Word Help | |||
when I Insert...Object in Word, want filename to exclude full pat. | Microsoft Word Help | |||
insert spaces | Page Layout |