Код: Выделить всё
Selection.MoveDown Unit:=wdLine, Count:=1
Модератор: Naeel Maqsudov
Код: Выделить всё
Selection.MoveDown Unit:=wdLine, Count:=1
Код: Выделить всё
If Selection.MoveDown(Unit:=wdLine, Count:=1) <> 1 Then ' конец
Код: Выделить всё
Sub m_4()
Dim oRange As Range
Set oRange = ActiveDocument.Range(Start:=ActiveDocument.Range.End - 1, End:=ActiveDocument.Range.End - 1)
If Selection.InRange(oRange) = True Then
Debug.Print "End of document"
End If
End Sub
Код: Выделить всё
Sub m_3()
If Selection.Start = ActiveDocument.Content.End - 1 Then
Debug.Print "The end of a document"
End If
End Sub
Код: Выделить всё
Public Function Range_IsStoryEnd(ByRef seRange As Word.Range) As Boolean
' возвращает True, если область seRange в конце части
Range_IsStoryEnd = False
If seRange Is Nothing Then
ElseIf seRange.End >= seRange.StoryLength - 1 Then
Range_IsStoryEnd = True
End If
End Function