V
viter.alex
I'm confused with count of lines in the range in the separate text
column different from the first. Here is macro sample:
Sub test()
ActiveDocument.PageSetup.TextColumns.Add CentimetersToPoints(7), ,
False
Debug.Print InsertText("first " & String(500, "a")).ComputeStatistics
(wdStatisticLines)
Selection.InsertBreak wdColumnBreak
Debug.Print InsertText("second " & String(500,
"b")).ComputeStatistics(wdStatisticLines)
Selection.InsertBreak wdColumnBreak
Debug.Print InsertText("third " & String(500, "c")).ComputeStatistics
(wdStatisticLines)
End Sub
Function InsertText(TextString As String) As Range
Dim nStart As Long
Dim nEnd As Long
nStart = Selection.Start
Selection.TypeText TextString
nEnd = Selection.End
Set InsertText = ActiveDocument.Range(nStart, nEnd)
End Function
As you can see returned count of lines doesn't correspond to reality
column different from the first. Here is macro sample:
Sub test()
ActiveDocument.PageSetup.TextColumns.Add CentimetersToPoints(7), ,
False
Debug.Print InsertText("first " & String(500, "a")).ComputeStatistics
(wdStatisticLines)
Selection.InsertBreak wdColumnBreak
Debug.Print InsertText("second " & String(500,
"b")).ComputeStatistics(wdStatisticLines)
Selection.InsertBreak wdColumnBreak
Debug.Print InsertText("third " & String(500, "c")).ComputeStatistics
(wdStatisticLines)
End Sub
Function InsertText(TextString As String) As Range
Dim nStart As Long
Dim nEnd As Long
nStart = Selection.Start
Selection.TypeText TextString
nEnd = Selection.End
Set InsertText = ActiveDocument.Range(nStart, nEnd)
End Function
As you can see returned count of lines doesn't correspond to reality