Hello,
in my testcase i tried to validate the content of tabels in microsoft word 2013.
But it was not possible to get the values out of the table? Do yo have any ideas
why?
I had a similar Problem in Microsoft Outlook 2013. Posted in the following Thread http://www.ranorex.com/forum/automating ... t1239.html
Thx
Automation Microsoft Word 2013
Automation Microsoft Word 2013
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Automation Microsoft Word 2013
Hi,
Thank you for the snapshot. It seems that this is the same problem as in Outlook 2013.
We will get back to you when we have found a possible solution.
Regards,
Markus (S)
Thank you for the snapshot. It seems that this is the same problem as in Outlook 2013.
We will get back to you when we have found a possible solution.
Regards,
Markus (S)
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Automation Microsoft Word 2013
Hi Flash,
Unfortunately, not all Office applications are supported in the same manner.
In order to validate text elements in a Word 2013 document you could use the following workaround:
First of all you need to add the Mircrosoft.Office.Interop.Word reference from GAC to your Ranorex solution.
This will allow you to use the following code:
Regards,
Markus (S)
Unfortunately, not all Office applications are supported in the same manner.
In order to validate text elements in a Word 2013 document you could use the following workaround:
First of all you need to add the Mircrosoft.Office.Interop.Word reference from GAC to your Ranorex solution.
This will allow you to use the following code:
var document1 = repo.Document1Word.Document1; var wordDocObj = document1.GetWordDocumentObject(); var words = wordDocObj.Words; foreach(Word.Range word in words) { Report.Info(word.Text); }One of my colleagues also posted a workaround in another topic. Therefore, please have a look at the following link: Automating Outlook
Regards,
Markus (S)
Re: Automation Microsoft Word 2013
Hi Markus,
I tried this one out but there is no way to intellisense a GetWordDocumentObject() out of my Word-Repo-Item.
- I added the reference from GAC to the project and did the usual "using Microsoft.Office.Interop.Word"
- my "document1" Repo-item is valid and holds the allocated Word instance. After that, typing "var wordDocObj = document1." gets out nothing from Interop.Word, no autocompletion for this.
Is there anything else to do?
Best regards
Bernd
I tried this one out but there is no way to intellisense a GetWordDocumentObject() out of my Word-Repo-Item.
- I added the reference from GAC to the project and did the usual "using Microsoft.Office.Interop.Word"
- my "document1" Repo-item is valid and holds the allocated Word instance. After that, typing "var wordDocObj = document1." gets out nothing from Interop.Word, no autocompletion for this.
Is there anything else to do?
Best regards
Bernd
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Automation Microsoft Word 2013
Hi Bernd,
In general there is nothing additional to do. I've added a small sample Ranorex Solution which should work as expected.
Please perform the following steps in order to run my test:
regards,
Markus (S)
In general there is nothing additional to do. I've added a small sample Ranorex Solution which should work as expected.
Please perform the following steps in order to run my test:
- Create a Word document named Document1
- Write some text in this document
- Open the sample solution and hit the run button.
regards,
Markus (S)
You do not have the required permissions to view the files attached to this post.
Re: Automation Microsoft Word 2013
Hi Markus,
thx for your example. I really appreciate your fast responce and your very helpfull replies
So, perhaps there was kind of a misleading description from my side. Reading from a stored .doc with office.interop wasn't the problem for me. I can do that.
I thought of a way to get data from Word on the fly. Your first example you gave looked to me as the repo element holds a Word instance whereas I'm able to fire the office.interop at.
In my very case, SUT opens up (triggered from Ranorex) a Word within some expected content. Without saving this Word document I targeted to validate the content and close the Doc without saving.
Sorry for the additional work I gave your with your example!
Is there a way to get information from an opened Word on the fly propperly?
Best regards
Bernd
thx for your example. I really appreciate your fast responce and your very helpfull replies
So, perhaps there was kind of a misleading description from my side. Reading from a stored .doc with office.interop wasn't the problem for me. I can do that.
I thought of a way to get data from Word on the fly. Your first example you gave looked to me as the repo element holds a Word instance whereas I'm able to fire the office.interop at.
In my very case, SUT opens up (triggered from Ranorex) a Word within some expected content. Without saving this Word document I targeted to validate the content and close the Doc without saving.
Sorry for the additional work I gave your with your example!
Is there a way to get information from an opened Word on the fly propperly?
Best regards
Bernd
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Automation Microsoft Word 2013
Hi Bernd,
I’m unfortunately not exactly sure if I got your question correctly, but in general it should also be possible to read data from a non-stored Word document with my sample.
Therefore, just adapt the path to find the desired Word document.
If you are still facing issues, please contact us by mail at [email protected]
Regards,
Markus (S)
I’m unfortunately not exactly sure if I got your question correctly, but in general it should also be possible to read data from a non-stored Word document with my sample.
Therefore, just adapt the path to find the desired Word document.
If you are still facing issues, please contact us by mail at [email protected]
Regards,
Markus (S)
Re: Automation Microsoft Word 2013
Hi Markus,
of course your example works. I was a little out of it
Thx
Bernd
of course your example works. I was a little out of it
Thx
Bernd