Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find Word, Excel or PPT Windows and manage them
#1
Solved: 10 Years, 8 Months, 4 Weeks ago
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:


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 Smile
Reply
#2
Solved: 10 Years, 8 Months, 4 Weeks ago
Use descriptive programming while you set your object for the documents. there could be difference in properties in OR and the document opened.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Check the word and get no. of times that word in the webpage Sandeep.san229 0 1,176 10-31-2018, 06:42 PM
Last Post: Sandeep.san229
  pageDown in word.application wannel 0 1,666 11-25-2016, 10:06 PM
Last Post: wannel
  Automating Word Docs bart02 0 2,682 07-18-2014, 03:25 AM
Last Post: bart02
  how to find Excel file exist or not in vbscript code sree.85 3 10,794 08-22-2013, 11:42 AM
Last Post: akhandesh
  Inserting Images in the Word file. atulparate 2 6,420 04-09-2012, 12:44 PM
Last Post: swathi

Forum Jump:


Users browsing this thread: 1 Guest(s)