Jump to content

Word Help


pro
 Share

Recommended Posts

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

#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 by pro
Link to comment
Share on other sites

#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

#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

:):lmao::think:

(Sorry for start this topic 3 times i am new in forums :shhh: )

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...