View Single Post
 
Old 08-12-2016, 05:51 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,436
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Marco, Graham,

The following also worked with Marco's example tables (a's, b's and c').

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oPar As Paragraph
Dim oRng As Range
Dim dblSize As Double
  For Each oPar In ActiveDocument.Paragraphs
    Set oRng = oPar.Range
    With oRng
      .MoveEnd wdCharacter, -1
      Do While .ComputeStatistics(wdStatisticLines) > 1
        dblSize = .Font.Size
        oRng.Font.Size = dblSize - 0.5
        If oRng.Font.Spacing > -0.3 Then oRng.Font.Spacing = oRng.Font.Spacing - 0.05
      Loop
    End With
  Next oPar
lbl_Exit:
  Exit Sub
End Sub
Still I am perplexed as to why I can select the first a, the last a, the first b, the last b, the first c and the then the last c and get the following results with

?Selection.Information(wdFirstCharacterLineNumber) in the Immediate windows

1
3
6
6
7
8

That indicates that the paragraphs containing the b's, the tiny empty paragraph after it and the paragraph containing the text "Test 2" is all contained within the same line and clearly visually at least it is not.

What makes this cell containing 3 paragraphs different from the other 2 or why is .Information(wdFirstCharacterLineNumber) reporting erratically in this case?
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote