473,657 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how save data in msword through vb6

10 New Member
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 3679
Dököll
2,364 Recognized Expert Top Contributor
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...

Dököll
Mar 9 '07 #2
rinku123
10 New Member
anybody if can help
then plz help me.
thanks lots
Mar 10 '07 #3
rinku123
10 New Member
plz help me soon
Mar 15 '07 #4
Dököll
2,364 Recognized Expert Top Contributor
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
Dököll
2,364 Recognized Expert Top Contributor
Also, rinku123, you have not yet posted any of your code. Do you have anything running?

Dököll
Mar 17 '07 #6
keeaun
2 New Member
guys,

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
  4.  
  5. List1.Clear
  6. array_data = "yes"
  7.  
  8. CommonDialog1.CancelError = True
  9. On Error GoTo CancelButton
  10. CommonDialog1.Filter = "Text files (*.txt|*.txt"
  11. CommonDialog1.ShowSave
  12. Newfile = CommonDialog1.FileName
  13.  
  14. Open Newfile For Output As #1
  15.  
  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
  22.  
  23. For Each list_array In received_data
  24.     Write #1, list_array
  25.     List1.AddItem List1.Text & vbCrLf & list_array
  26. Next
  27.  
  28. Close #1
  29.  
  30. CancelButton:
  31. Exit Sub
Apr 4 '07 #7
Dököll
2,364 Recognized Expert Top Contributor
guys,

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

List1.Clear
array_data = "yes"

CommonDialog1.C ancelError = True
On Error GoTo CancelButton
CommonDialog1.F ilter = "Text files (*.txt|*.txt"
CommonDialog1.S howSave
Newfile = CommonDialog1.F ileName

Open Newfile For Output As #1

If array_data <> "" Then
ReDim Preserve received_data(T ext3.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
Next

Close #1

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

Expand|Select|Wrap|Line Numbers
  1.  
  2. CommonDialog1.CancelError = True
  3. On Error GoTo CancelButton
  4. CommonDialog1.Filter = "Text files (*.txt|*.txt"
  5. CommonDialog1.ShowSave
  6. Newfile = CommonDialog1.FileName
  7.  
  8.  
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.F ilter = "Text files (*.txt|*.txt"
CommonDialog1.S howSave

(4) Lastly, delete "Newfile = CommonDialog1.F ileName", 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!

Dököll
Apr 7 '07 #8

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

Similar topics

3
9008
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 "application/msword". My question is how to save the word document which is edited to the database. Thanks for your advice!
0
1165
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 ??
0
1646
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";
1
1957
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 users with two open/save as dialogs. this happens only when select "Open" button. This issue is commented in this articles: http://mosley.arach.net.au/dev/docs/save%20as.htm
8
12215
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 what i'm missing, I use Fiddler and I got my header and body to a very close match, but the content-length is slightly off and I got no clue why Sorry for the lengthy post, but i have no other way of showing my work
1
1115
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; filename=Document.doc") Response.Write(strDoc) Response.ContentType = a Response.End()
2
14712
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 name=fileupload</input> </form>
3
4622
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 Type. However, when the user clicks "Save", the "Save As File Type" in the resulting dialog displays 'HTML Document'. There is only one other entry in the list - "All Files". How can I modify the code to display "Excel Document" (or some such)...
1
4530
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 word Printout or quit parameter have I to set to diff. than Missing Obj. to get word printout to work Its can't be right that I have to user timer delay of word quit command.
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6164
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.