[RESOLVED]Change text in an Object text
Hi to all:
I have this code to change the text in a text object on CR:
Code:
Dim Report As New CRAXDRT.Application
Dim rpt As CRAXDRT.Report
Set Report = New CRAXDRT.Application
Set rpt = Report.OpenReport(App.Path & "\selecao.rpt")
Dim objrpt As Object
Dim rptsection As CRAXDRT.Section
Set rptsection = rpt.Sections("PH")
Set objrpt = rptsection.ReportObjects(2)
If objrpt.Kind = crTextObject Then
objrpt.Name = "Segunda"
End If
The problem that's the code don't change any text in the desired text object
Any suggestion to do this?
Thanks
Re: Change text in an Object text
Try next syntax changing object & variables names
Code:
Dim myTextObject As CRAXDRT.TextObject
Set myTextObject = myReport.Sections("RH").ReportObjects("Text1")
myTextObject.SetText "Segunda"
Re: Change text in an Object text
Yes...Work your suggestion
Thanks a lot