StenchBlossoms 0 Posted May 7, 2010 Hi guys, Recently starting to use AutoIt and I'm trying to fill in a form I have which in .doc format. I've tried the following so far but I'm not getting any postive results. #NoTrayIcon #include<Word.au3> $formName = "\form.doc" $word = ObjCreate("Word.Application") $word.visible = True $word.Documents.open($formName) $word.Selection.Find.Text = "Name:"; $word.Selection.Find.ClearFormatting(); $word.Selection.Find.Replacement.Text = "Name: John"; $word.Selection.Find.Replacement.ClearFormatting(); $word.Selection.Find.Forward = true; $word.Selection.Find.Execute Would anyone be able to help? Link to examples of this? I've already looked through the help documents but haven't found anything similar. Thanks Share this post Link to post Share on other sites
SAG 0 Posted May 8, 2010 (edited) Check the Word management UDF functions in the AutoIt Help files. In your example, it might look like this: #include <Word.au3> $oWordApp = _WordCreate("", 0, 0) $oWord = _WordDocOpen($oWordApp, $formName) _WordDocFindReplace($oWord, "Name:", "Name: John") _WordDocSave($oWord) _WordDocClose($oWord) _WordQuit($oWordApp) Edit: made example more complete Edited May 8, 2010 by SAG Share this post Link to post Share on other sites
StenchBlossoms 0 Posted May 9, 2010 Check the Word management UDF functions in the AutoIt Help files. In your example, it might look like this: #include <Word.au3> $oWordApp = _WordCreate("", 0, 0) $oWord = _WordDocOpen($oWordApp, $formName) _WordDocFindReplace($oWord, "Name:", "Name: John") _WordDocSave($oWord) _WordDocClose($oWord) _WordQuit($oWordApp) Edit: made example more complete Thank you. I will try this. Share this post Link to post Share on other sites