MrChimp,
In your application you could remember the rowid of your text object and just update this for each new layout you want to print.
Combining this with Egge-Jan's suggestion would look like this:
1. Have a modular variable to hold the rowid of the text object to update
2. Have a procedure to find the rowid of the text object - this must only be called once (unless you delete from your layout - that might not even make a difference either)
3. Have a procedure that can update the text object, using the rowid read
'**Dim a variable to hold the RowID of the text object
Dim mnRowIDRefIDText As Integer
'**Procedure that is called to set the rowid of the text object
'**assumes that the frontwindow is the layout to update
'**assumes that the
Sub HereTheRowIDOfTheTextObjectIsSet
Dim sLayoutTable As String
Dim oText As Object
Dim aObj As Alias
sLayoutTable = WindowInfo(FrontWindow(), WIN_INFO_TABLE)
aObj = sLayoutTable + ".OBJ"
Fetch First From sLayoutTable
Do Until EOT(sLayoutTable)
oText = aObj
Do Case ObjectInfo(oText, OBJ_INFO_TYPE)
Case OBJ_TYPE_TEXT
Do Case ObjectInfo(oText, OBJ_INFO_TEXTSTRING)
Case "[REFNUMBER]"
mnRowIDRefIDText
'Case .. please add other cases if you need to
End Case
End Case
Loop
End Sub
'**Procedure that is called to update the content of the layout window
'**assumes that the frontwindow is the layout to update
'**it also assumes that you have set the rowid of the text object some where else
Sub HereTheLayoutWillBeUpdated()
Dim sLayoutTable As String
Dim oText As Object
Dim aObj As Alias
sLayoutTable = WindowInfo(FrontWindow(), WIN_INFO_TABLE)
aObj = sLayoutTable + ".OBJ"
Fetch Rec mnRowIDRefIDText From sLayoutTable
oText = aObj
Alter Object oText Info OBJ_INFO_TEXTSTRING, "Here goes some new values"
Update sLayoutTable
Set OBJ = oText
Where ROWID = mnRowIDRefIDText
End Sub
I hope this makes sense
Peter Horsbøll Møller
Pitney Bowes Business Insight - MapInfo