Jump to content

Pull control names from VB6


Recommended Posts

Hello, recently I have started writing up automation scripts in visual studio. These scripts require me to know the (name) field in the properties of controls written in vb6.

  1. My idea here is to open up the screen in vb6, I won't have the code checked out so i wont have to worry about altering it.
  2. Some how cycle through the screen and record the (name) property for each control. The controls are named in a way that I should know if i need them or not. (ex. fraFrame1 wouldn't be needed because its a frame while txtTextbox1 will be needed for me to enter data into it)
  3. Once I have all the fields I will be testing, I would want autoit to use those (name)'s to put in as much of the script as possible on my Visual Studio test files.
  4. After the mindless part of the testfile is done then I can do the small specifics on my own.

So the main issue I have right now is just starting out, I can't think of a way to actually select the controls in vb6 and pull out what is marked in the (name) field. On top of that I have another idea but getting the name is priority 1.  If that was figured out I could maybe figure out how to also check for additional properties.

Any help on this would be great... i know it sounds more confusing than it actually is since I am not great at explaining things.

Edit: Might have found a way around checking the actual screen for controls then looking at the Properties section of the screen. It seems I could just open the .ctl file as a text file and run through the document looking for keywords.

Not 100% how that will work, I would probably want to search the whole document for any (name) properties starting with wte/txt/cbo/wde/mle then save those names into an array? So when I want to dump the data into a new document I could just do a For Each for the items that make up the array.

Let me know if this sounds like something that might work.

Edited by ledigeine
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...