Blacktongue Posted October 16, 2007 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
Foy Posted October 16, 2007 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
Foy Posted October 16, 2007 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.
Moderators big_daddy Posted October 16, 2007 Moderators 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now