pro Posted January 21, 2009 Share Posted January 21, 2009 (edited) I Have this Script : When somebody clicks on "save in word' it automaticly gets the text from $input_naam and $edit_hobby and saves it in word. Could somebody help me ? In advanced THX (Sorry for Bad English) Pro expandcollapse popup#include <GuiConstants.au3> #include <Inet.au3> #include <GUIConstantsEx.au3> #include <Word.au3> ; GUI Creation GuiCreate("GUI Control Examples", 500, 420) $Button_word = GUICtrlCreateButton("Save in Word",400,40) $input_naam = GuiCtrlCreateInput("Typ your name", 100, 40, 130, 20) $edit_hobby = GUICtrlCreateEdit("Type here your hobby's", 100,100,200,300) GUISetState(@SW_SHOW) ; Continuous Loop to check for GUI Events While 1 $msg = GUIGetMsg() Select Case $msg = $Button_word $oWordApp = _WordCreate () $oDoc = _WordDocGetCollection ($oWordApp, 0) $oDoc.Range.Text = "Name " _WordDocSaveAs ($oDoc, @ScriptDir & "\name.doc") EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Edited January 21, 2009 by pro Link to comment Share on other sites More sharing options...
Madza91 Posted January 21, 2009 Share Posted January 21, 2009 #include <GuiConstants.au3> #include <Inet.au3> #include <GUIConstantsEx.au3> #include <Word.au3> ; GUI Creation GuiCreate("GUI Control Examples", 500, 420) $Button_word = GUICtrlCreateButton("Save in Word",400,40) $input_naam = GuiCtrlCreateInput("Typ your name", 100, 40, 130, 20) $edit_hobby = GUICtrlCreateEdit("Type here your hobby's", 100,100,200,300) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $Button_word $oWordApp = _WordCreate () $oDoc = _WordDocGetCollection ($oWordApp, 0) $name = GUICtrlRead($input_naam) $hobby = GUICtrlRead($edit_hobby) $oDoc.Range.Text = $name & @CRLF & $hobby _WordDocSaveAs ($oDoc, @ScriptDir & "\name.doc") EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
pro Posted January 21, 2009 Author Share Posted January 21, 2009 #include <GuiConstants.au3> #include <Inet.au3> #include <GUIConstantsEx.au3> #include <Word.au3> ; GUI Creation GuiCreate("GUI Control Examples", 500, 420) $Button_word = GUICtrlCreateButton("Save in Word",400,40) $input_naam = GuiCtrlCreateInput("Typ your name", 100, 40, 130, 20) $edit_hobby = GUICtrlCreateEdit("Type here your hobby's", 100,100,200,300) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $Button_word $oWordApp = _WordCreate () $oDoc = _WordDocGetCollection ($oWordApp, 0) $name = GUICtrlRead($input_naam) $hobby = GUICtrlRead($edit_hobby) $oDoc.Range.Text = $name & @CRLF & $hobby _WordDocSaveAs ($oDoc, @ScriptDir & "\name.doc") EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Thank you very much (Sorry for start this topic 3 times i am new in forums ) Link to comment Share on other sites More sharing options...
Madza91 Posted January 21, 2009 Share Posted January 21, 2009 No problem... Btw, Welcome to AutoIt [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
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