cyberchief Posted November 15, 2005 Report Share Posted November 15, 2005 I am working with a program where the control text changes with each account I pull up. The Classes are the same, but the text of the control changes to that of the account name. I need to click on a certain button which is itself a button. Problem is... I can't choose Get Control because that uses the current name... I can't choose capture because it could be anywhere on the screen. Is there a way to set a specific control through programming? I can get the account name off of the program... I would like to be able to use that to set the control text. but how do you do that and set the class to button without using the get control? Does anyone have any other ideas? Quote Link to comment Share on other sites More sharing options...
kevin Posted November 15, 2005 Report Share Posted November 15, 2005 David, I had exactly the same issue when we were creating the Window Control commands. The Variable Set Control Text command is meant to do what you need. Try this: Use the Get Control command to get the control information for the button. Use the Text method for the control by making sure 'Get Control Using Text' is selected in the Get Control Utilitity. Do not worry about the actual text that appears on the component (button). In your macro, use the Variable Set Control Text to select which text should appear in the control. We have a program that has a single button with a caption that changes; the button can display Done, Print, Save, or EMail. The Variable Set Control Text command allows me to write a macro using a single Control variable and change the Text of the Control variable to match the caption on the button. However, if the control cannot be identified using the Text method of getting the Windows control then this method will not work. Quote Link to comment Share on other sites More sharing options...
randallc Posted November 15, 2005 Report Share Posted November 15, 2005 hi, or sometimes works; 1. Get control first to get location, 2. then use location to use capture. best, Randall Quote Link to comment Share on other sites More sharing options...
cyberchief Posted November 15, 2005 Author Report Share Posted November 15, 2005 Thanks Radall and Kevin. I had tried both of them... but I can't seem to get any of them to work. The program I am using has windows within windows... but these individual windows are not recognized in MS Windows. just a pain. hey, you have any ideas on my other post? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.