Jump to content

Control ID


Recommended Posts

Hi everyone. I have a question. Lets say i try to open Microsoft Excel and i want to open a file from there.

Run("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE")
WinWaitActive("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE","",1)
Send("^o")
Sleep("1000")
$sFolder = 'C:\Documents and Settings\operator\My Documents\niew\'
ControlSetText('Open', '', 'RichEdit20W2', $sFolder) 
ControlClick('Open', '', 'Button1')

Normally for others programs such as Notepad and when i want to save or open a file, the Control ID, ClassNameNN, Text, Style and ExStyle values are all shown on the AutoIt v3 Active Window Info. But Microsoft applications such as Microsoft Excel, i've tried to open file and it came out a open dialog box. when i use my mouse to point over the (Look in:) icon, the AutoIt v3 Active Window Info doesn't shown any values. So how can i type my address into the (Look in:) icon so that i can extract my file from the correct folder??...thanks if anyone can help me..thanks.. =)

Link to comment
Share on other sites

Hi everyone. I have a question. Lets say i try to open Microsoft Excel and i want to open a file from there.

Run("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE")
WinWaitActive("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE","",1)
Send("^o")
Sleep("1000")
$sFolder = 'C:\Documents and Settings\operator\My Documents\niew\'
ControlSetText('Open', '', 'RichEdit20W2', $sFolder) 
ControlClick('Open', '', 'Button1')

Normally for others programs such as Notepad and when i want to save or open a file, the Control ID, ClassNameNN, Text, Style and ExStyle values are all shown on the AutoIt v3 Active Window Info. But Microsoft applications such as Microsoft Excel, i've tried to open file and it came out a open dialog box. when i use my mouse to point over the (Look in:) icon, the AutoIt v3 Active Window Info doesn't shown any values. So how can i type my address into the (Look in:) icon so that i can extract my file from the correct folder??...thanks if anyone can help me..thanks.. =)

Instead try using Filename box in the same window and put your full location wherever the file is saved. Looks like the ClassName for Filename is "RichEdit20W2".. Hope this helps!! Edited by Ram
Link to comment
Share on other sites

Instead try using Filename box in the same window and put your full location wherever the file is saved. Looks like the ClassName for Filename is "RichEdit20W2".. Hope this helps!!

Thanks Ram! I've tried it and it works!.. Thanks! =) cheers..

Link to comment
Share on other sites

Thanks Ram! I've tried it and it works!.. Thanks! =) cheers..

Hum dont see how above code can work:

Run("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE")

WinWaitActive("Microsoft Excel","","")

Send("^o")

WinWait("Open","","")

$sFolder = @MyDocumentsDir & "\Work\Job schedule.xls"

ControlSend("Open", "", "RichEdit20W2", $sFolder & "{ENTER}")

Link to comment
Share on other sites

  • 2 weeks later...

Hum dont see how above code can work:

Run("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE")

WinWaitActive("Microsoft Excel","","")

Send("^o")

WinWait("Open","","")

$sFolder = @MyDocumentsDir & "\Work\Job schedule.xls"

ControlSend("Open", "", "RichEdit20W2", $sFolder & "{ENTER}")

Tested your code.. it works fine..!!

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...