Jump to content
Sign in to follow this  
targeter

detecting if program has fully loaded ( outlook, word, and other office 2010 programs)

Recommended Posts

targeter

I am having trouble getting window detection of any office program. I downloaded the office developer list of control IDs

http://www.microsoft.com/downloads/details.aspx?FamilyID=3f2fe784-610e-4bf1-8143-41e481993ac6&displaylang=en

However, I still can't get it to work. Anyone know of a way to detect when the program fully loads? WinWait only checks to see if the title exists, and technically since the program is loading the title bar exists even though you can't see it. I need a way to detect when the program and all its controls are available.....

I want the script to halt basically until it can detect the controls.

for a office 2010 and win7 situation

Send("{LWINDOWN}{LWINUP}",0) ; Open Microsoft Start Menu & Open Outlook
Send("Outloo" & "{ENTER}",0)
Opt("WinTitleMatchMode", 2)
$windowstatus = 0
While $windowstatus <>1
$windowstatus = ControlCommand("Outlook","", 478 , "IsVisible","")
    Sleep(500)
WEnd
MsgBox(0,"test", $windowstatus)
Edited by targeter

Share this post


Link to post
Share on other sites
FlyinRiz

I am having trouble getting window detection of any office program. I downloaded the office developer list of control IDs

http://www.microsoft.com/downloads/details.aspx?FamilyID=3f2fe784-610e-4bf1-8143-41e481993ac6&displaylang=en

However, I still can't get it to work. Anyone know of a way to detect when the program fully loads? WinWait only checks to see if the title exists, and technically since the program is loading the title bar exists even though you can't see it. I need a way to detect when the program and all its controls are available.....

I want the script to halt basically until it can detect the controls.

for a office 2010 and win7 situation

You could have it open the Options menu (since it won't process the keystrokes until it's fully open) and then wait for that window. Then you could just put a close command as soon as it see's it and you're good to continue. I'm sure there is a better way, but I think that should work.

-Aaron

Share this post


Link to post
Share on other sites
targeter

I think I better pull out my copy of VB6, I need Spy++

Share this post


Link to post
Share on other sites
Ascend4nt

Perhaps try 'WinActivate()' ? It's worked for me in the past..

Share this post


Link to post
Share on other sites
seandisanti

You could just do everything programatically using the objects exposed. as soon as the Application object is created, all of it's properties, methods, and members are available to your code through COM. anything that you'd be doing through menus, controls, etc can all be done behind the scenes without even needing to display the windows... from any office app use Alt+f11 to go into the vba interface, then F2 to open the object browser, and F1 to open help. with those two resources (and the assistance of people on this forum and others) you can get away from the interface and get things done more efficiently.

Share this post


Link to post
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
Sign in to follow this  

×