Jump to content
Macro Express Forums

Modify Control Text


cyberchief

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...