Save a Word File
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2010
08:49 AM
03-27-2010
08:49 AM
Save a Word File
My application invokes a report in word file format.
TC should save it in a folder. I create the folder using aqfilesystem.
Is there a builtin function to enter some data in the word file and save the it in the specified folder?
TC should save it in a folder. I create the folder using aqfilesystem.
Is there a builtin function to enter some data in the word file and save the it in the specified folder?
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2010
11:20 PM
03-29-2010
11:20 PM
Hi,
Here is sample code:
Here is sample code:
function WriteTextToDOC(input, output, text)
{
var WordObject = Sys.OleObject("Word.Application");
WordObject.Documents.Open(input);
WordObject.ActiveDocument.Content = text;
WordObject.ActiveDocument.SaveAs(output);
WordObject.ActiveDocument.Close();
WordObject.Quit();
WordObject = null;
while (Sys.WaitProcess("WINWORD", 500).Exists) {
Delay(500);
}
}
// ...
WriteTextToDOC('c:\\input.doc', 'c:\\output.doc', 'Sample Text');
// ...
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2010
11:29 PM
03-29-2010
11:29 PM
Thank you very much.
