Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can QTP AOM identify word documents that are already opened
#1
Not Solved
Hi,

One of my application opens two word documents. My test objective is like this:
1. Check If there are two word documents opened
2. Close one of the word document and check the other is still open or not
3. Close the second document and check no word documents are open.

I am trying to handle this documents using QTP AOM, but I am not able to find anything that works.

Can anyone help on this.

Best regards,
Anil
Reply
#2
Not Solved
Hi Anil,

sorry for Late Reply.

Please check the below code

Code:
Set element = description.Create
element("micclass").value = "Window"
element("regexpwndtitle").value = "Microsoft Word"
Set col = Desktop.ChildObjects(element)

msgbox col.count

For i =0 to col.count-1
    col(i).close

Next

it might be useful for some other people
Thanks
-Tanya
Reply
#3
Not Solved
Hi Tanya,

Thanks for the reply. The above approach works very well. I was trying to use AOM i.e CreateObject("Word.Application") which wasn't identifying already created word docs. I think what you suggested is the best way to deal with this, which I did too.

Cheers,
Anil
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT Word automation wannel 1 2,363 10-31-2016, 06:59 PM
Last Post: wannel
  [UFT] Close opened folder robertosalemi 1 3,389 02-10-2016, 07:06 PM
Last Post: robertosalemi
  Error while saving an already opened Excel TurtleRock 1 3,551 08-28-2014, 06:35 PM
Last Post: dplank
  AOM script is running only one or two scripts. jramya 4 4,193 07-24-2014, 06:15 PM
Last Post: jramya
  How to invoke the recording of QTP using AOM(automation object model) of QTP shailesh.gcettb@gmail.com 2 4,181 05-08-2014, 10:30 AM
Last Post: Shriram

Forum Jump:


Users browsing this thread: 3 Guest(s)