See if Selection.Information(wdFirstCharacterLineNumber) or
<RangeObject>.Information(wdFirstCharacterLineNumber) gives you what you
want. I'm afraid I have never worked with line numbers in VBA.
Well this is what I found, Assuming a column could be set as a
range(?) the following code was suggested by Chris Greaves to return
line numbers for both beginning and end of column as well as the total
line count for the column..
Function lngLineStart(rng As range) As Long
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Function: lngLineStart
''' Comments: Return LONG the line number at the start of the
given range.
''' Arguments: RANGE The range of text being
examined.
''' Returns: LONG
''' Comments:
'''
''' Date Developer Action
'''
--------------------------------------------------------------------------
''' 2011/02/11 Chris Greaves Created
'''
lngLineStart = rng.Information(wdFirstCharacterLineNumber)
'Sub TESTlngLineStart()
' MsgBox lngLineStart(Selection.Range)
'End Sub
End Function
Function lngLineEnd(ByVal rng As range) As Long
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Function: lngLineEnd
''' Comments: Return LONG the line number at the end of the
given range.
''' Arguments: RANGE The range of text being
examined.
''' Returns: LONG
''' Comments:
'''
''' Date Developer Action
'''
--------------------------------------------------------------------------
''' 2011/02/11 Chris Greaves Created
'''
Dim rng2 As range
Set rng2 = rng
rng2.Start = rng.End + 1
lngLineEnd = rng2.Information(wdFirstCharacterLineNumber) - 1
'Sub TESTlngLineEnd()
' MsgBox lngLineEnd(Selection.Range)
'End Sub
End Function
Function lngLineCount(ByVal rng As range) As Long
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Function: lngLineCount
''' Comments: Return LONG the count of lines in the given range.
''' Arguments: RANGE The range of text being
examined.
''' Returns: LONG
''' Comments:
'''
''' Date Developer Action
'''
--------------------------------------------------------------------------
''' 2011/02/11 Chris Greaves Created
'''
Dim lngS As Long
lngS = lngLineStart(rng)
Dim lngE As Long
lngE = lngLineEnd(rng)
lngLineCount = lngE - lngS + 1
If lngLineCount = 0 Then ' only a part of line was given
lngLineCount = 1
Else
End If
'Sub TESTlngLineCount()
' MsgBox lngLineCount(Selection.Range.Paragraphs(1).Range)
'End Sub
End Function