Domino Code Fragment

Code Name*
Pulling a Value From Current Table Cell With LotusScript
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.145.105.108
Description*
The following script retrieves the contents of the currently selected cell, rounds it to two decimals,
and then writes is back to same cell. This assumes that the data in the cell is numeric.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Problem:
How can I pull information from a table cell in Word Pro, manipulate it in some way and then write
it back to that same cell?

Solution:
The following script retrieves the contents of the currently selected cell, rounds it to two decimals,
and then writes is back to same cell. This assumes that the data in the cell is numeric.

Sub Main
Set ThisCell = .Currentcell
CurrVal = ThisCell.Content.GetText ($LwpGetObjectTypeParagraph ,False)
RoundVal=Round(CurrVal,2)
ThisCell.Deletecontents
ThisCell.Content.InsertText RoundVal
End Sub