473,223 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,223 software developers and data experts.

how save data in msword through vb6

suppose in vb form are more then one textbox which is contain data and i want i click command button it save in msword file and it can replace many times suppose just like we make report).

i have no experience about it i seen a exe file of vb6.
which contain a msword file in this file some label & textbox control is placed
i dont know how is it.

and when i press commnd button which is in vb6 form. its data display i msword file Label and Textbox control.

so plz help me.
and give me full process or guidliness.
or code which can i use o how to save ms word file with controls.
Mar 8 '07 #1
7 3645
2,364 Expert 2GB
Greetings and salutations, rinku123!

You can do this in two ways:

(1) You can add data through your VB form and save as .doc. That'll give you an MS Word file (provided you have MS Office installed)

(2) You can add data through your VB form
-Built an MS Access Database
-Add data to it
-Add DataReport/Data Environment in VB
-Run a report
Again, provided you have MS Office installed

That should get you going.

I would choose choice one, just to see what happens, then go crazy and add an Access database just for fun :-)

It's exciting either way...

Mar 9 '07 #2
anybody if can help
then plz help me.
thanks lots
Mar 10 '07 #3
plz help me soon
Mar 15 '07 #4
2,364 Expert 2GB
Did you try option # 1?

What this means is, if you name the file being saved as myfile.doc you will ten have a document saved in word...
Mar 17 '07 #5
2,364 Expert 2GB
Also, rinku123, you have not yet posted any of your code. Do you have anything running?

Mar 17 '07 #6

below is my code to save the data in notepad
can anyone pls teach me how to autosave cos this code there will be a pop up window for saving..
thanks a lot.

Expand|Select|Wrap|Line Numbers
  1. Dim array_data As String
  2. Dim x As Integer
  3. Dim list_array As Variant
  5. List1.Clear
  6. array_data = "yes"
  8. CommonDialog1.CancelError = True
  9. On Error GoTo CancelButton
  10. CommonDialog1.Filter = "Text files (*.txt|*.txt"
  11. CommonDialog1.ShowSave
  12. Newfile = CommonDialog1.FileName
  14. Open Newfile For Output As #1
  16. If array_data <> "" Then
  17.     ReDim Preserve received_data(Text3.Text)
  18.     For x = 0 To Text3.Text
  19.     received_data(x) = x & "," & array_data
  20.     Next x
  21.     End If
  23. For Each list_array In received_data
  24.     Write #1, list_array
  25.     List1.AddItem List1.Text & vbCrLf & list_array
  26. Next
  28. Close #1
  30. CancelButton:
  31. Exit Sub
Apr 4 '07 #7
2,364 Expert 2GB

below is my code to save the data in notepad
can anyone pls teach me how to autosave cos this code there will be a pop up window for saving..
thanks a lot.

Dim array_data As String
Dim x As Integer
Dim list_array As Variant

array_data = "yes"

CommonDialog1.CancelError = True
On Error GoTo CancelButton
CommonDialog1.Filter = "Text files (*.txt|*.txt"
Newfile = CommonDialog1.FileName

Open Newfile For Output As #1

If array_data <> "" Then
ReDim Preserve received_data(Text3.Text)
For x = 0 To Text3.Text
received_data(x) = x & "," & array_data
Next x
End If

For Each list_array In received_data
Write #1, list_array
List1.AddItem List1.Text & vbCrLf & list_array

Close #1

Exit Sub
It is very likely you do not need this here:

Expand|Select|Wrap|Line Numbers
  2. CommonDialog1.CancelError = True
  3. On Error GoTo CancelButton
  4. CommonDialog1.Filter = "Text files (*.txt|*.txt"
  5. CommonDialog1.ShowSave
  6. Newfile = CommonDialog1.FileName
Above deals with your dialog box, which you do not need. Could you do me a bg favour and delete the lines one by one, then run your code. I cannnot try this as of now:

(1) Delete "CommonDialog1.CancelError = True", then run code
(2) Delete "On Error GoTo CancelButton" then run code
(3) If code runs fine, delete:

CommonDialog1.Filter = "Text files (*.txt|*.txt"

(4) Lastly, delete "Newfile = CommonDialog1.FileName", only if pop up nop longer come up.

Anyone, please assist keeaun, I must run and cannot run this as of now. keeaun, please save this project before you do what I suggested, but I would delete the dialog data if I did not want to get a pop up before saving.

In a bit!

Apr 7 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

by: lee_j | last post by:
Hi, I have a question below. In the Sql server 2000 I store some word documents.Then I get the data from the database through the asp code and display the word document in IE.The ContentType is...
by: Neil_T | last post by:
I need to convert a msword document to PCL format and save to the filesystem on the server. This needs to be triggered from an asp page. Any ideas ??
by: Tom Gao | last post by:
hi guys I'm trying to export an aspx page to msword. ############# I know you can do Response.Clear(); Response.ContentType="application/msword";
by: David Perez | last post by:
Hello. I have a problem with my Web Application in VB.NET and aspx pages. I try to open a SaveDialog window, to open or save a document when user clicl on a button, and Internet Explorer prompts...
by: Du | last post by:
I'm trying to automate the upload process to yousendit.com, but the file size doesn't add up and yousendit.com keep rejecting my upload (it accepts the upload until the very end) I don't know...
by: Vijay Neelam | last post by:
Hi all, Dim a As String = Response.ContentType Response.Clear() Response.Buffer = True Response.ContentType = "application/msword" Response.AddHeader("content-disposition", "attachment;...
by: Cuong.Tong | last post by:
Greeting, Can anyone give me some hints about parsing the mulitpart/form-data stream? I have a form looks something like this <form action="process.dll> <input type=file...
by: Bob Murdoch | last post by:
I am sending an attachment to a user with the following code. This successfully prompts the user to Save or Open, provides the correct file name, and displays "Microsoft Excel Worksheet" as the...
by: =?Utf-8?B?S2ltIFM=?= | last post by:
I have a word document I only want to printout ( not save as file ) and I use Word printout method in backgrund but my XP operativ i so slow that a "dummy" dociment also get stored. which...
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.