Ask a Question

Working with Word document and identifying the last line

Occasional Contributor

Working with Word document and identifying the last line

Dear All

Thanks for all your suggestions for my previous query. I have a new query, request you to help on this. Currently i am planning to create a report in word file, where i can add text and also screenshot for detailing. I have found way to add text and also to add screenshot to word. But when the log gets added, text is getting placed in same line and in sameway screenshots are also placed over the same line. So everything falls in a cluster.


Please help me to know how to add text and screenshot in next line to the previous line. I tried to activate the document and give keyboard action using Sys.Keys("[Enter]"), which dint work out. Also there are very less content regarding working with word, so i got stuck here.




Community Hero

Could you tell us how you access Word and more information on the work already done ?


Did u follow the TC sample:

<TestComplete 14 Samples>\Common\MSOffice\JScript\Word_JScript





Un sourire et ça repart

Community Hero



As @BenoitB said before. An example You can see these lines of code:



  // Makes the title 
  SelectFont("Arial", 24, wdBlue, true, false);
  MsWord.Selection.InsertAfter("TestComplete Report");
  MsWord.Selection.MoveDown(wdParagraph, 1);


Based on this example you will achieve the desired result.


SmartBear Alumni (Retired)

Thanks for the suggestions, guys!


@Saira16, was the issue resolved? Please let us know if you need any more assistance.

Tanya Yatskovskaya
SmartBear Community and Education Manager

Occasional Contributor

Sorry for late reply, i tried with link you shared and got what i wanted. Thanks for your help.

Occasional Contributor

Yes, by trying out one of the method as suggested above in the link i was able to move forward. Thanks

Occasional Contributor

Thanks for your suggestion, i will also try to use this. Currently  i have tried the solution provided above by BenoitB. I will also try your suggestion.

Showing results for 
Search instead for 
Did you mean: