Print Page | Close Window

Text Object

Printed From: TMS Software
Category: .NET Components
Forum Name: .NET Flexcel
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=1969
Printed Date: 14 Nov 2019 at 10:23pm


Topic: Text Object
Posted By: Brindley David
Subject: Text Object
Date Posted: 16 Nov 2012 at 7:19am
Hi,
 
I'm new to Flexcel and so far everything has been straightforward.

However, I have a legacy Excel 2003 spreadsheet (supplied by a third party) which my software needs to export data into.
 
This spreadsheet has some textbox objects on and I need to set the text within this object to some data from my database. This particular textbox object has a name Text 627
 
I've done the following to find the object which it does but I'm getting stuck on the line to actually set the text of the object.
 
Dim intLoop As Integer
For intLoop = 1 To xls.ObjectCount
Dim ShapeProps As TShapeProperties = xls.GetObjectProperties(intLoop, True)
Dim ShapeOption As TShapeOption
If ShapeProps.ShapeName IsNot Nothing Then
If ShapeProps.ShapeName = "Text 627" Then
???????????
End If
End If
Next
 
I've tried using SetObjectProperty but I can't seem to get the syntax right. I'm sure I'm just being a bit thick but any help or advise would be gratefully recieved.
 
 
 



Replies:
Posted By: Adrian Gallero
Date Posted: 16 Nov 2012 at 7:47am
Hi,
You were almost there :)

Just replace "????????" by:
xls.SetObjectText(intLoop, """Hello")
And it should work. 
Regards,
  Adrian


Posted By: Brindley David
Date Posted: 16 Nov 2012 at 8:14am
Thanks Adrian,
 
Works a treat.



Print Page | Close Window