View Full Version : paragraph limit
ilkamalo
08-26-2012, 04:11 PM
this is first time here so sorry for errors
i write this code
Selection.Font.Size = 12
Selection.Font.Bold = True
Selection.TypeText Text:="OGGETTO: "
Selection.Font.Bold = True
Selection.TypeText Text:="RRRRRRRRRRRRRRRRR "
Selection.TypeParagraph
With Selection.ParagraphFormat
.LeftIndent = CentimetersToPoints(2.2)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
End With
With Selection.ParagraphFormat
.RightIndent = CentimetersToPoints(0)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
End With
Selection.Font.Bold = True
Selection.TypeText Text:="YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
and i get result W1
the fact is that i need result W2
can help on this,thank so much
macropod
08-27-2012, 11:27 PM
Try:
With Selection
With .ParagraphFormat
.LeftIndent = CentimetersToPoints(0)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
End With
With .Font
.Size = 12
.Bold = True
End With
.TypeText Text:="OGGETTO: "
.TypeText Text:="RRRRRRRRRRRRRRRRR "
.TypeParagraph
.Collapse wdCollapseEnd
.ParagraphFormat.LeftIndent = CentimetersToPoints(2.2)
.TypeText Text:="YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
End With
chandansify
08-30-2012, 02:38 AM
this is first time here so sorry for errors
i write this code
Selection.Font.Size = 12
Selection.Font.Bold = True
Selection.TypeText Text:="OGGETTO: "
Selection.Font.Bold = True
Selection.TypeText Text:="RRRRRRRRRRRRRRRRR "
Selection.TypeParagraph
With Selection.ParagraphFormat
.LeftIndent = CentimetersToPoints(2.2)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
End With
With Selection.ParagraphFormat
.RightIndent = CentimetersToPoints(0)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
End With
Selection.Font.Bold = True
Selection.TypeText Text:="YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
and i get result W1
the fact is that i need result W2
can help on this,thank so much
this is an interesting requirement.
However, the only way I see to achieve W2 is to use non breaking space in place of normal space.
e.g. try below code to get W2.
Sub anothertest()
Selection.Font.Size = 12
Selection.Font.Bold = True
Selection.TypeText Text:=Replace("OGGETTO: ", Chr(32), Chr(160))
Selection.Font.Bold = True
Selection.TypeText Text:=Replace("RRRRRRRRRRRRRRRRR ", Chr(32), Chr(160))
' Selection.TypeParagraph
With Selection.ParagraphFormat
.LeftIndent = CentimetersToPoints(2.2)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
End With
With Selection.ParagraphFormat
.RightIndent = CentimetersToPoints(0)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
End With
Selection.Font.Bold = True
Selection.TypeText Text:=Replace("YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY", Chr(32), Chr(160))
End Sub
Cheers :thumb
macropod
08-30-2012, 02:50 AM
this is an interesting requirement.
However, the only way I see to achieve W2 is to use non breaking space in place of normal space.
If you took the time to study the code I posted - or even run it - you'd find:
a) the problem is solved; and
b) your conjecture about non breaking spaces is pure nonsense.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.