Textbox Name or Index

 

Does anyone know if it is possible to change the Name or Index of a textbox object?

I do not see a way, and this makes programming with them very difficult.  I need to recreate a textbox on a sheet without having to change any code.  This is not easy without being able to rename it to what is already in the code.

It appears as if its location is the only attribute that can be reset.

Any other ideas?

 

Posted by: Carl Breving
Post date: 6/22/2007 8:28:42 AM

7 REPLIES

RE: Textbox Name or Index

 

Will adding an attribute set to the textbox object and an attribute to store my own name work?

This makes it a little more ugly but at least possible.

 

Posted by: Carl Breving
Post date: 6/22/2007 8:38:54 AM

RE: Textbox Name or Index

 

Carl,

I looked at the TypeLib definition for a TextBox.  I didn't see any way to rename it or anything.  Regarding the attribute set approach, you'll just have to try it and see.  I've never worked with the attribute sets so I don't know the answer.  Good luck.

 

Posted by: Jason Newell
Post date: 6/25/2007 7:24:47 AM

RE: Textbox Name or Index

I ran into this problem as well about a year ago. Kash from UGS told me that it was not programmatically possible. What I ended up doing was having blank balloons in my title block with which I already knew the index numbers. Then I programmatically changed some custom properties that I assigned the balloons to, and then performed an UpdatePropertyText. My advantage is that I have these balloons on the background sheets, so users don't delete them by mistake. The only caveat is if the user does a "Save As" with an older template that does not have these pre-defined ballons or textboxes.

 

You can try to cycle through the Balloons and see if the text string or location matches what you want to change:

 

For z = 1 To .Balloons.Count

If .Balloons(z).BalloonText = "My text" Then

do som function here

End If

Next z

 

 

Good luck.

 

Posted by: Bill Ledbetter
Post date: 7/9/2007 7:10:17 AM

RE: Textbox Name or Index

 

The only problem is if you ever update the template you have to be careful about deleting textboxes, because there is no way to recreate them with the same index.

I think I am going to put the textbox on a specific layer and/or add an attribute to the attribute set to give the texbox a specific name.

We also put everything on the background sheet so it is less likely to get modified by users.  But, inevitably someone still messes with it on occasion.  Thanks for the reply.

 

Posted by: Carl Breving
Post date: 7/9/2007 8:34:48 AM

RE: Textbox Name or Index

If you can get that to work, then definately go that route. I couldn't get it to function with a name or attribute. I'm told that those would be "Read Only" values, liek Index.

 

If you get it to work, can you let me know, because as you mentioned, I have to have a tight grip on the templates.

 

Thanks

 

 

Posted by: Bill Ledbetter
Post date: 7/10/2007 12:34:51 PM

RE: Textbox Name or Index

 

Bill.

Here is what I did to accomplish this.  I created a callout, put that callout in a group.  Then I added an AttributeSet to the group with a specific name.  Now when I want to find that callout I simply find the group with the attribute set name and I know that it is the only callout in that group.

The nice thing about this is that a user cannot create or recreate the group manually, nor can they add anything additional to that group.

If the group doesn't exist I send the user an error message and record in a log file that they have been messing with the template.

 

Posted by: Carl Breving
Post date: 8/1/2007 6:17:21 AM

RE: Textbox Name or Index

Thanks Carl,

 

I'll look at that method for my applications.

 

Posted by: Bill Ledbetter
Post date: 8/6/2007 7:08:00 AM