By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,592 Members | 2,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,592 IT Pros & Developers. It's quick & easy.

Write from VB6 to MS Word

P: 47
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
Share this Question
Share on Google+
2 Replies


VijaySofist
100+
P: 107
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

P: 47
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

Post your reply

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