-
Mar 26th, 2017, 08:18 AM
#1
Thread Starter
Registered User
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
-
Mar 26th, 2017, 10:50 AM
#2
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
-
Mar 27th, 2017, 04:43 AM
#3
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
-
Mar 27th, 2017, 10:15 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|