Variable in COM name

Get help with using AutoHotkey and its commands and hotkeys
gilliduck
Posts: 265
Joined: 06 Oct 2014, 15:01

Variable in COM name

26 Jul 2015, 16:12

I'm sure my terminology is wrong, but I'm wanting to have a variable in a COM object, but I'm getting invalid name errors.

Code: Select all

wb2.Document.All.%user_pass%.value := "11111"
the %user_pass% is my variable obviously, but the format doesn't appear to play well with this. Is there a way to do what I want or am I just screwing up the syntax elsewhere and that's why I'm getting an error?
gilliduck
Posts: 265
Joined: 06 Oct 2014, 15:01

Re: Variable in COM name

26 Jul 2015, 16:39

NVM, think I got it

wb2.Document.All.(user_pass).value := "11111"
User avatar
jethrow
Posts: 188
Joined: 30 Sep 2013, 19:52
Location: Iowa

Re: Variable in COM name

27 Jul 2015, 00:43

See the all property. When in doubt, try the call in javascript. Any of the following are appropriate:

Code: Select all

document.all(user_pass)
document.all[user_pass]
document.all.item(user_pass)

Return to “Ask For Help”

Who is online

Users browsing this forum: boiler, bushez, Flipeador, Google [Bot], mikeyww, Xtra and 40 guests