Discussion:
macro run error!
(too old to reply)
forrest
2010-03-05 15:25:01 UTC
Permalink
I need change the change all the text paragrahp setting as follow:
“Paragraph-Indents and Spacing-Spacing-Before:0.5line, line sapcing:At least
At:0pt" I make this change and record a macro, and then select the rest of
the test, run the marco, but it shows error like this:
error in office 2007:" Run-time error'5149': The measurement must be between
0.7 pt and 1584 pt"
error in office 2003 : "Run-time error'5362': The measurement must be "

how could I fix this problem? I need to set the number as 0.5 instead of 0.7
forrest
2010-03-05 15:34:01 UTC
Permalink
sorry, macro2 is the record macro. not macro 1
Sub Macro1()
'
' Macro1 Macro
'
Selection.PasteAndFormat (wdPasteDefault)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p^p"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "^p^w"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "^w^p"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ","
.Replacement.Text = ","
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "."
.Replacement.Text = "。"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "!"
.Replacement.Text = "!"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "!"
.Replacement.Text = "!"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.ClearFormatting
With Selection.Find
.Text = "!"
.Replacement.Text = "!"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "。。"
.Replacement.Text = "。"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub Macro2()
'
' Macro2 Macro
' 宏在 2010-3-5 由 微软用户 录制
'
With Selection.ParagraphFormat
.LeftIndent = CentimetersToPoints(0)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 2.5
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceAtLeast
.LineSpacing = 0
.Alignment = wdAlignParagraphJustify
.WidowControl = False
.KeepWithNext = False
.KeepTogether = False
.PageBreakBefore = False
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = CentimetersToPoints(0)
.OutlineLevel = wdOutlineLevelBodyText
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0.5
.LineUnitAfter = 0
.AutoAdjustRightIndent = True
.DisableLineHeightGrid = False
.FarEastLineBreakControl = True
.WordWrap = True
.HangingPunctuation = True
.HalfWidthPunctuationOnTopOfLine = False
.AddSpaceBetweenFarEastAndAlpha = True
.AddSpaceBetweenFarEastAndDigit = True
.BaseLineAlignment = wdBaselineAlignAuto
End With
End Sub
Post by forrest
I need change the change all the text paragrahp setting as follow:
“Paragraph-Indents and Spacing-Spacing-Before:0.5line, line sapcing:At least
At:0pt" I make this change and record a macro, and then select the rest of
error in office 2007:" Run-time error'5149': The measurement must be between
0.7 pt and 1584 pt"
error in office 2003 : "Run-time error'5362': The measurement must be "
how could I fix this problem? I need to set the number as 0.5 instead of 0.7
Doug Robbins - Word MVP
2010-03-05 21:10:56 UTC
Permalink
It is probably the Line Spacing of 0pt that is causing the error. Through
the user interface, the minimum that it can be set to is 1pt (probably being
the 0.7pt that the error message mentions, rounded to 1pt)
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
Post by forrest
I need change the change all the text paragrahp setting as follow:
“Paragraph-Indents and Spacing-Spacing-Before:0.5line, line sapcing:At least
At:0pt" I make this change and record a macro, and then select the rest of
error in office 2007:" Run-time error'5149': The measurement must be between
0.7 pt and 1584 pt"
error in office 2003 : "Run-time error'5362': The measurement must be "
how could I fix this problem? I need to set the number as 0.5 instead of 0.7
forrest
2010-03-11 12:50:01 UTC
Permalink
I need set the value to 0.5pt, not 1pt. Is there anything I can do to fix that?
Post by Doug Robbins - Word MVP
It is probably the Line Spacing of 0pt that is causing the error. Through
the user interface, the minimum that it can be set to is 1pt (probably being
the 0.7pt that the error message mentions, rounded to 1pt)
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
Post by forrest
I need change the change all the text paragrahp setting as follow:
“Paragraph-Indents and Spacing-Spacing-Before:0.5line, line sapcing:At least
At:0pt" I make this change and record a macro, and then select the rest of
error in office 2007:" Run-time error'5149': The measurement must be between
0.7 pt and 1584 pt"
error in office 2003 : "Run-time error'5362': The measurement must be "
how could I fix this problem? I need to set the number as 0.5 instead of 0.7
Doug Robbins - Word MVP
2010-03-11 21:14:15 UTC
Permalink
0.7pt is the smallest that you can make it. If you try and set it to
anything less you will get the following error message

"Run-time error '5149':

The measurement must be between 0.7 pt and 1584 pt.

While the software will quibble over it, I doubt that anyone in their right
mind will quibble over 0.2pt - less than the thickness of a sheet of normal
office paper.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
Post by forrest
I need set the value to 0.5pt, not 1pt. Is there anything I can do to fix that?
Post by Doug Robbins - Word MVP
It is probably the Line Spacing of 0pt that is causing the error.
Through
the user interface, the minimum that it can be set to is 1pt (probably being
the 0.7pt that the error message mentions, rounded to 1pt)
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
Post by forrest
I need change the change all the text paragrahp setting as follow:
“Paragraph-Indents and Spacing-Spacing-Before:0.5line, line sapcing:At least
At:0pt" I make this change and record a macro, and then select the rest of
error in office 2007:" Run-time error'5149': The measurement must be between
0.7 pt and 1584 pt"
error in office 2003 : "Run-time error'5362': The measurement must be "
how could I fix this problem? I need to set the number as 0.5 instead
of
0.7
Continue reading on narkive:
Loading...