Domino Code Fragment

Code Name*
Determining the End of a File with LotusScript
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.224.214.215
Description*
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Problem:
How can you determine if the insertion point is located at the end of a document using LotusScript
?

Solution:
Word Pro documents are comprised of the following text streams:

- Main body
- Headers/Footers
- Frames
- Tables

The .AtEnd property off of the Text class can be used to tell if the insertion point is at the end of one
of these text streams. To make sure the insertion point is in the main body text stream you can send
use the .Type method to send the ESCAPE key twice to the document.

For example:
Sub Main
.Type "[Esc][Esc]" 'ensures that the insertion point is in the main body text stream
If .Text.AtEnd = True then
Messagebox "At the end of the document."
Else
Messagebox "Somewhere in the document."
End If
End Sub