473,320 Members | 1,839 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,320 software developers and data experts.

Write from VB6 to MS Word

hai all!
i ve created a small program for billing the products.Now i want to write the bill to MS word and store it.i ve got the product info in variables.this i want to write in MS word.i just know how to open the word document.i seriously dont know how to write text.kindly give me the code or an idea if possible.
pls.
most urgent
Dec 23 '07 #1
2 2176
VijaySofist
107 100+
Hi!

The Following code may fulfill your needs.

Expand|Select|Wrap|Line Numbers
  1. Dim FileContent As String
  2. FileContent = "Give All Your Text or Pass the Variables Here"
  3. Open "D:\file.doc" For Output As #1
  4. Print #1,FileContent
  5. Close #1
  6.  
In the Above Coding, Instead of file.doc give your filename with the ".doc" extension.


All The Best

With Regards
Vijay. R
Dec 24 '07 #2
Hi!

The Following code may fulfill your needs.

Expand|Select|Wrap|Line Numbers
  1. Dim FileContent As String
  2. FileContent = "Give All Your Text or Pass the Variables Here"
  3. Open "D:\file.doc" For Output As #1
  4. Print #1,FileContent
  5. Close #1
  6.  
In the Above Coding, Instead of file.doc give your filename with the ".doc" extension.


All The Best

With Regards
Vijay. R



Thank you soooo much!that was really helpful!is there a way to place the text in specific places?..wat can i refer for this?
Dec 25 '07 #3

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

Similar topics

9
by: Dominic Godin | last post by:
Hi, I have an asp page that does a lot of processing and reports it's finished by printing the word "Success". For example: <% SomeFunction(SomeVar) SomeFunction(SomeVar1) ...
3
by: john | last post by:
I need to produce a RTF-document which is filled with data from a database. I've created a RTF-document in WordPad (a template, so to speak) which contains 'placeholders', for example '<dd01>',...
6
by: dale zhang | last post by:
Hi, I am using StreamWriter to write text files now. What is the easiest way to write a word table to a file? XML + style? Thanks. -Dale
6
by: Tom C. | last post by:
Hi I'm trying to create a web form that will print a MS Word doc from the web form. I'm using VB.net. This is the code example Dim WordApp As New Word.Applicati Private Sub...
2
by: pchahar | last post by:
Write a program to process a text file. The program will determine how many unique words there are in the text file that begin with each letter of the alphabet. The text file name will be given as a...
0
by: prashant | last post by:
Hi all I need to write into word document through VB.NET. The data is supposed to come from the textbox created by me using the com addins. The text box is appears in the command bar area. The...
3
by: oncue01 | last post by:
Word Puzzle Task You are going to search M words in an N × N puzzle. The words may have been placed in one of the four directions as from (i) left to right (E), (ii) right to left (W), (iii) up...
0
Gyanchand
by: Gyanchand | last post by:
Actually we need to use a Word template and insert cetain values through ASP. What I have done currently is : Have created a page in HTML and written the HTML to a text file and saved it as an doc...
3
by: Maurizio | last post by:
I create an application with Access 2000 and I wish to read/write the properties of a specified word document. I use dsofile.dll my code is Function fGetDocProps(strInFile As String, strProp As...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.