Results 1 to 4 of 4

Thread: how to create a executable file in vb6.0 by which we can insert data in a form

  1. #1

    Thread Starter
    Registered User
    Join Date
    Mar 2017
    Posts
    1

    how to create a executable file in vb6.0 by which we can insert data in a form

    hi all,
    i am a beginner in vb 6.0 environment,please some help me to create a executable file in which when i run that file a user input form will open which contains some text boxes,sir when some user fill data in this textbox and press a Button placed on this form,a word file should open in which this text box data should be shown,this word file contains data already
    suppose a user form created with a text box field address then if a user enters data in address field and press ok button just after it a word file should open which have the matter like my name is abcd and my address is"_______" here blank space should be fill by the text box data,i hope some one will surely help me

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: how to create a executable file in vb6.0 by which we can insert data in a form

    Thread moved to Classic VB from CodeBank, which is for posting completed code rather than questions.
    My usual boring signature: Nothing

  3. #3
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: how to create a executable file in vb6.0 by which we can insert data in a form

    Probably would be a good idea if you provided an example of what the Word document would look like after your program had run.
    If it is a simple case of opening a new word file, and pasting the data from your VB6 form, then this may help -
    Re: [FAQ's: OD] How do I read/write to a document?
    Another method of writting contents to a Word document is by pasting the contents of the Windows Clipboard into your Word document.
    Code:
        Word 2003 VB 6 Code Example (Write):
        Option Explicit
        'Add a areference to MS Word xx.0 Object Library
        Private Sub Command1_Click()     
            Dim oApp As Word.Application
            Dim oDoc As Word.Document        
            Set oApp = New Word.Application
            oApp.Visible = True
            Set oDoc = oApp.Documents.Add
            oDoc.Activate
            oDoc.Select
            oApp.Selection.Paste 'Pastes whatever is on the clipboard.
            'Clean up objects
            Set oDoc = Nothing
            Set oApp = Nothing        
        End Sub
    If you need something more elaborate, the same web page that I just copied that from, has more complex solutions -
    http://www.vbforums.com/showthread.p...-to-a-document

    Hope this helps,
    Rob

  4. #4
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    759

    Re: how to create a executable file in vb6.0 by which we can insert data in a form

    If you want to fill in fields inside a Word document, then I would argue your best bet would be to create a Word Form.

    Insert Form Fields into the document for the parts that you want the user to enter, then protect the entire document so that only these fields can be changed; the rest is fixed.

    If you want to create a Word document containing many pages, each one containing a name or address, then looking Word's Mail Merge capabilities.

    Regards, Phill W.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width