Hi folks,
i want to check if i have an open Excel/Word/Powerpoint Window on my Desktop. When i ll find one i want to manage it e.g. save the document. I got three objects in my repository and if my script will find the window, i want to manage it by referencing the object from my repository to my objOfficeApp variable:
My approach for finding the windows works. Here my script:
But that doesnt work. I think i make a mistake in referencing my found object window with my variable.
Do u have any advice for me to solve my issue?
Important: My Testcases can open one of these Applications (e.g. Excel, Word, PPT) and i want to find (that works) and manage the window! Is there another (maybe better) approach?
Thanks in advance
Stefan
i want to check if i have an open Excel/Word/Powerpoint Window on my Desktop. When i ll find one i want to manage it e.g. save the document. I got three objects in my repository and if my script will find the window, i want to manage it by referencing the object from my repository to my objOfficeApp variable:
My approach for finding the windows works. Here my script:
Code:
[font=Courier]If Window("regexpwndclass:=OpusApp").Exist Then
Set objOfficeApp = Window("Microsoft Word")
Exit function
end if
If Window("regexpwndclass:=PP10FrameClass").Exist Then
set objOfficeApp = Window("Microsoft PowerPoint")
Exit function
End If
If Window("regexpwndclass:=XLMAIN").Exist Then
set objOfficeApp = Window("Microsoft Excel")
Exit function
End If[/font]
[font=Arial]And now i want to manage the window:[/font]
[font=Courier]objOfficeApp.Activate
...[/font]
But that doesnt work. I think i make a mistake in referencing my found object window with my variable.
Do u have any advice for me to solve my issue?
Important: My Testcases can open one of these Applications (e.g. Excel, Word, PPT) and i want to find (that works) and manage the window! Is there another (maybe better) approach?
Thanks in advance
Stefan