Blacktongue 0 Posted October 16, 2007 Hi: I am another newbie and don't mind spending some time at learning auto it but would appriceiate some general guidance. I am trying to write a treeview gui that lets me select multiple large blocks of text with checkboxes at different levels in the tree and then combines them and sends them all to a WORD document. I am doing okay with the treeview and checkboxes I think, but don't know the best way to insert very large blocks of text into word. The text includes symbols, formats, punctuation marks, etc. ... Is 'send' the only way to do this? This would involve a tremendous amount of formatting details in the code which I would like to avoid. Thanks, BT Share this post Link to post Share on other sites
Foy 0 Posted October 16, 2007 (edited) $file = FileOpen("DocumentNameHere.txt", 9) ;9 means if it doesnt exist it creates the file AND it opens it in write mode adding all new info to the bottom $text = "Your text here lawl I suppose depending on your text there'd be an easier way..." ;your text FileWrite($file, $text) ; writes the info to the new fil I guess... lol Beats Send() by a mile Edited October 16, 2007 by Foy Share this post Link to post Share on other sites
Foy 0 Posted October 16, 2007 Send() only simulates keystrokes and there's a delay as they are not instant, also if the user decides to use his keyboard while it's Send()-ing then it screws up the text being sent. It also can only send to teh active window, FileWrite() sends it almost instantly and silently. Hope that all helps. Share this post Link to post Share on other sites
big_daddy 20 Posted October 16, 2007 Something like this? #include <Word.au3> $sText = FileRead(@WindowsDir & "\WindowsUpdate.log") $oWordApp = _WordCreate() $oDoc = _WordDocGetCollection($oWordApp, 0) $oDoc.Range.Text = $sText Share this post Link to post Share on other sites